0
我有一个数组如何在表中使用与输入占位符ngFor Angular2
public example = [['hallo', 'fruit', 'rose'], ['apple','book']]
我想打的输入表,其值取决于哪部分我现在用 http://localhost:4200/app?part=1
和
http://localhost:4200/app?part=2
我在组件获得此信息
this.part = this.activatedRoute.snapshot.queryParams['part'];
我想这个代码
<table>
//choose 0 or 1 array in example array (this works!)
<tr *ngFor="let a of example[part-1]">
<td><input> </td>
</tr>
</table>
我的问题是,如果我尝试插入占位符或ngFor到输入我没有得到我的结果...我该如何解决这个问题?
第二个是正是我需要的,谢谢! –