I am using Angular 9.
I am trying to construct a dynamic table from a 2 dimensional array.
I have the following which displays the first element succesffully.
<mat-card class="approval-edit-card-nominated">
Nominated Evaluators
<div>
{{nominationAllOf[0].nominations[0].evaluatorInfo.personalInfo.name.firstName}}
{{nominationAllOf[0].nominations[0].evaluatorInfo.personalInfo.name.lastName}}
</div>
</mat-card>
However, I want to make a table that displays all rows and columns. So I try the following:
<mat-card class="approval-edit-card-nominated">
Nominated Evaluators {{nominationAllOf[0].nominations.length}}
<div>
<table>
<tr *ngFor="let nomination of nominationAllOf">
<td *ngFor="let item of nomination">
{{item.evaluatorInfo.personalInfo.name.firstName}}
{{item.evaluatorInfo.personalInfo.name.lastName}}
</td>
</tr>
</table>
</div>
</mat-card>
The {{nominationAllOf[0].nominations.length}} is 3. But the table is just not displayed.
Question
How do I display the table from the 2 dimensional array?
Error
ERROR Error: Cannot find a differ supporting object '[object Object]' of type 'object'. NgFor only supports binding to Iterables such as Arrays.
Thanks
<td *ngFor="let item of nomination.nominations">