I have a nested array structured like this:
tests: [
[{name:"Bob",score:40,subject:"Math"}, {name:"John",score:55,subject:"Math"}],
[{name:"Alice",score:70,subject:"English"},{name:"John",score:68,subject:"English"}]
],
// ...
My goal is to loop through the array and print the data while grouping students by subjects. Here's my attempt:
<div *ngFor = "let test of tests;let i = index">
<ul *ngFor = "let student of test[i] ;let n = index">
<li>{{student.name+' '+student.score}}</li>
</ul>
</div>
However, I encounter an error that says:
ERROR Error: Cannot find a differ supporting object
[object Object]
of type 'object'. NgFor only supports binding to Iterables such as Arrays.
This error occurs during the second loop. Can anyone help me understand what I'm missing here?