I’m trying to use ngFor to bind object value from an object list/array to an Ion-Input field;
e.g. Array< User > --> [ngModel]=“user.name”.
This works like it should when I’m using it without ngFor. It binds the value from the object to the Inputfield and the Inputvalue to the object.
Inside of a ngFor it just binds the object initial value to the Inputfield but not the other way.
I searched for a while and found that this seemed to be a Bug in earlyer versions of Ionic2 and I tryed some “fixes” that seems to work when using ion-input in forms:
<ion-input item-left type="number" [ngModel]="user.workedHours" name={{user.ID}}>
<ion-input item-left type="number" [ngModel]="user.workedHours" id={{user.ID}}>
But that and a few other options didn’t worked for me.
I don’t know if I just missed the Fix for this in a ngFor or I’m just missing anything.
Would be great if some of you can help me or tell me that this is not just happening to me
PS: I got a work around with the blur event with something like that: (blur)=“saveValue(user)”