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到輸入我沒有得到我的結果...我該如何解決這個問題?
第二個是正是我需要的,謝謝! –