Je rencontre ce problème lors de l'affectation d'un tableau d'objets à un tableau basé sur une interface.
Actuellement j'ai cette implémentation sur mon interface item.ts
export interface IItem {
id: number, text: string, members: any
}
et sur le fichier item.component.ts
export class ItemComponent {
selectedItems: IItem[] = [];
items: IExamItems;
getSelected(): void {
this.selectedItems = this.items.examItems.map(examItem=> examItem.item)
}
}
il semble que j'obtienne toujours cette erreur
TS2322: Type 'IItem[][]' is not assignable to type 'IItem[]'.
Type 'IItem[]' is not assignable to type 'IItem'.
Property 'id' is missing in type 'IItem[]'.