Could somebody help me with the following code and give me a reason why it does not work. I am creating a series of inputs from a string array and I want to bind each input value to its corresponding slot in the string array. Seems to be pretty standard, but I do not seem to grasp the issue.
I have tried the following two cases, but the Colors array (=string[]) remains empty!
<tr *ngFor="let color of Colors; let i = index;">
<td>
<mat-form-field>
<input required matInput placeholder="Color ({{ i + 1}})" [name]="'color_' + i" [(ngModel)]="color">
</mat-form-field>
</td>
</tr>
<tr *ngFor="let color of Colors; let i = index;">
<td>
<mat-form-field>
<input required matInput placeholder="Color ({{ i + 1}})" [name]="'color_' + i" [(ngModel)]="Colors[i]">
</mat-form-field>
</td>
</tr>