4

有没有一种方法可以动态设置 ngModel 的值?例如

<h1>please fill the text</h1>
<div *ngFor="#value of columnsNames">
    {{value }}<input type = "text" [(ngModel)]="SomeDynamicValue">
</div>
4

1 回答 1

1
<div *ngFor="#value of columnsNames">
    {{value }}<input type = "text" [(ngModel)]="SomeDynamicValue[value]">
</div>
于 2017-03-15T20:48:58.317 回答