I have these two interfaces:
export interface interface1 {
id: number;
name: string;
description: string;
isActive: boolean;
address?: {};
}
export interface interface2 extends interface1 {
route: string;
}
When I implement interface2 like this:
const const1: interface2 = [
id: 1,
name: 'abc',
description: 'desc',
isActive: true,
route: '/'
]
While compiling I am getting all properties listed as missing. Not sure what I am doing wrong. I checked this playground it seems working fine:
Example
>Solution :
It seems that there is a syntax error in the implementation of const1. Instead of using square brackets, you should use curly braces to define an object literal.
const const1: interface2 = { id: 1, name: 'abc', description: 'desc', isActive: true, route: '/' };