Set ngModel dynamically in Angular2

Is there a way in which I can set the ngModel value dynamically? eg

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

All Articles