2017-10-28 88 views

回答

2

它應該是,

<div *ngFor="let Server of Servers; let i = index; let f=first; let l=last;" > 
    <p> {{Server}}</p> 
</div> 
0

您已經包括{{Servers}},而不是在<p>標籤{{Server}}

<div *ngFor="let Server of Servers; let i = index; let f=first; let l=last;" > 
    <!-- Change to this --> 
    <p>{{Server}}</p> 
    <!-- Change to this --> 
</div> 

簡單的例子是:

<div *ngFor="let item of Servers;" > 
    <p>{{item}}</p> 
</div> 
0

最合理的解決:

<ion-list> 
    <ion-item ion-item *ngFor="let Server of Servers; let i = index; let f=first; let l=last;""> 
    <p> {{Server}}</p> 
    </ion-item> 
</ion-list> 

整蠱一個(不推薦):

<div *ngFor="let Server of Servers; let i = index; let f=first; let l=last;" > 
<p> {{Server}}</p> 
<br/> 
</div> 
+0

如何在arr中推送文本框的值唉,並將其顯示在屏幕上? –

+0

' ' 'push(){Servers.push(this.newValue) –