如何在ngModel中使用動態變量?Angular 2 - ngModel中的動態變量
我嘗試使用下面的代碼,但出現以下錯誤:
<div *ngFor="let num of ['1','2','3']; let i=index">
<input id="qtd{{num}}" [(ngModel)]="qtd{{num}}" type="text"/>
</div>
埃羅
Unhandled Promise rejection: Template parse errors: Parser Error: Got interpolation ({{}})
使用數組,並使用'qtd [num]'。 –
你能舉個例子嗎? – rafaelcb21