My question is very simple, how to correctly use the ng-model in an array of strings?
I tried this:
Component.ts
toDos: string[] =["Todo1","Todo2","Todo3"];
Component.html
<div *ngFor="let item of toDos;let index = index">
<input [(ngModel)]="toDos[index]" placeholder="item" name="word{{index}}">
</div>
This does not generate any errors, but when trying to change the contents of the inputs ... it does not work, it does not work correctly.
In the following StackBlitz the problem is shown when you try to edit a input: StackBlitz
How should this be done?
Thank you very much!