I am trying to get the length from Array interface. But getting error as:
error TS2339: Property 'length' does not exist on type 'ModelSubSystems'. In this case how to get the length. here is my TS code:
@Input() subsystems: ModelSubSystems;
resolve({ data: this.subsystems, totalCount: this.subsystems.length }); //error
here is my interfaces:
export interface ModelSubSystem {
Id: number;
Name: string;
CreatedBy: string;
CreatedDate: Date;
UpdatedBy: string;
UpdatedDate: Date;
}
export interface ModelSubSystems {
subsystems: Array<ModelSubSystem>; //this is array!!
}
any one help me with correct approach. Thanks in advance.
this.subsystems.length, orthis.subsystems.subsystems.length?@Input() subsystems: ModelSubSystems.subsystem;but got the error as@Input() subsystems: ModelSubSystems.subsystem;But getting warning asModelSubSystems only refer to a type, but being used as a name space here