我正在使用Angular2 Final版本(2.1.0).当我想显示公司列表时,我收到了这个错误.
在file.component.ts:
public companies: any[] = [
{ "id": 0, "name": "Available" },
{ "id": 1, "name": "Ready" },
{ "id": 2, "name": "Started" }
];
Run Code Online (Sandbox Code Playgroud)
在file.component.html:
<tbody>
<tr *ngFor="let item of companies; let i =index">
<td>{{i}}</td>
<td>{{item.name}}</td>
</tr>
</tbody>
Run Code Online (Sandbox Code Playgroud)