Recently, I've encountered a perplexing error that has left me stumped. Can anyone offer guidance on how to resolve this issue?
ERROR Error: Cannot find a differ supporting object '[object Object]' of type 'object'. NgFor only supports binding to Iterables such as Arrays.
The JSON Array
[{
"studentname": "ddd",
"age": 10,
"school": {
"s_name": "abc school",
"school_city": "nsw"
}
}]
<div *ngFor="let stu of this.studentSelected; let i = index;" >
<tr > <td>{{stu.studentname}} :</td>
<ng-container *ngFor="let sof stu .school">
<td>{{s.school_city}}</td>
</ng-container>
</tr>
</div>
Although the error message specifies that NgFor only works with Arrays, I'm struggling to see how to fix this code.