我有一个内部带有对象的数组,如下所示。
public feeds: any[] =[];
this.feeds["card_2"] = { cod: "66812720", des: "4X5kg", top: "Normal" };
this.feeds["card_6"] = { year: "YTD 2018", value: "17.1M" };
this.feeds["card_7"] = { year: "YTD 2019", value: "1.3M" };
this.feeds["card_8"] = { growthYTD: "-92.50%" };
我尝试了以下代码:
<div *ngFor ="let key of keys">
{{key}}
<tr *ngFor="let row of feeds[key]">
<td>{{row.des}}</td>
<td></td>
</tr>
</div>
但是我无法进入循环并显示任何内容。
请帮助。