I'm currently facing an issue with assigning an array of objects to an interface-based array.
Here is the current implementation in my item.ts interface:
export interface IItem {
id: number, text: string, members: any
}
In the item.component.ts file:
export class ItemComponent {
selectedItems: IItem[] = [];
items: IExamItems;
getSelected(): void {
this.selectedItems = this.items.examItems.map(examItem=> examItem.item)
}
}
However, I keep encountering 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[]'.