Why am I receiving the message in Angular 9 that says: Type Items is not assignable to type (Items & NgIterable) | undefined | null?
Despite the fact that the model is correct and there are no errors in the data, I still encounter this TypeScript warning.
Here is the structure of myData model:
interface Item {
url: string;
label: string;
}
export interface Items {
[key:number]: Item ;
}
My HTML code snippet:
<ng-container *ngFor="let card of myData"><!-- the warning occurs here -->
some content
</ng-container>
UPDATED: I realized that I forgot to provide an example data to clarify the situation. Here is an array as an example:
[
{
url: 'todo',
label: 'Rekeningnummer'
},
{
url: 'todo',
label: 'Postadres'
}]