Can someone help me understand the correct way to use ng-model in an array of strings?
I attempted the following:
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>
Although this code does not show any errors, it doesn't update the input contents correctly. Can anyone provide guidance on the correct approach?
You can see the issue in action on this StackBlitz example when attempting to edit an input field: StackBlitz
I would appreciate any help or suggestions on how to resolve this problem. Thank you!