2016-08-08 18 views

回答

0

您可以使用內置的指令* ngFor在angular2.0。

<table> 
    <tr *ngFor="let x of names"> 
      <td>{{ x.Name }}</td> 
      <td>{{ x.Country }}</td> 
    </tr> 
</table> 
+0

在哪裏添加表格創建.. –

+0

你應該在相應的@Component() –

+0

中添加'模板:'部分1.創建main.ts - > AppComponent 2.在AppComponent - > aravind-form 3. aravind- form-component - >聲明變量和使用的模板URL 4. aravind.form.component.html - >創建行文本框和列文本並提交按鈕。 我的問題:用戶將鍵入任何行,列。 點擊提交時應該顯示基於行號,用戶輸入的列的表嗎? –

相關問題