I have an array of data that include textboxes that binding to ngModel
My problem is that all the textbox (with the same type of parent) binding to the same model.And by changing the element the other element changed.
This is my code:
<ng-template #textbox let-field="field" let-i="i" let-j="j">
j={{j}}, i={{i}}
<input [name]="'ctrl' +i+ j" type="text" [(ngModel)]="data[i].control.fields[j].value" >
</ng-template>
I change the ngModel from "field.value" to [(ngModel)]="data[i].control.fields[j].value"
try to fix like here Angular 2 - 2 Way Binding with NgModel in NgFor but it doesnt work.
The weird part it that it is binding just to the same type of parent