我有一个绘制网格的循环,然后从该循环的索引开始。 我寻找一个返回数组的数组
<div *ngFor="let day of columnsOfDays; let d = index">
...
<span *ngFor="let aula of findGroups(d)">{{aula?.name}}</span>
此函数根据索引进行搜索并返回一个数组
findGroups(d: any) {
return groups = this.groups.dayWeek.find(dayWeek => {
return dayWeek.idDay=== d;
}).aulas;
}
我想要做的就是这样
"aulas=findGroups(d)" <--- Store temp in html array to use later
<span *ngFor="let aula of aulas">{{aula?.name}}</span>