I have this problem on assigning an array of objects to an interface based array
Currently I have this implementation on my interface item.ts
export interface IItem {
id: number, text: string, members: any
}
and on the item.component.ts
export class ItemComponent {
selectedItems: IItem[] = [];
items: IExamItems;
getSelected(): void {
this.selectedItems = this.items.examItems.map(examItem=> examItem.item)
}
}
it seems that i'm always getting this error
TS2322: Type 'IItem[][]' is not assignable to type 'IItem[]'.
Type 'IItem[]' is not assignable to type 'IItem'.
Property 'id' is missing in type 'IItem[]'.
IExamItemsinterface declaration