I have a weird problem.
I am using Angular CLI and I have added Material 2 to it. I created some inputs with ngfor
and bound them to ngmodel
. Everything is working fine.
But whenever I type something, the input becomes deselected.
This is the HTML code of the component:
<md-input-container class="treatments" *ngFor="let t of treatment; let i = index">
<input mdInput placeholder="treatment {{ i + 1 }}"
value="{{ t[i] }}" name="treatment_{{ i + 1 }}" [(ngModel)]="treatment[i]">
</md-input-container>
When I remove the ngmodel
, it does work 100%.