I have an *ngFor directive. I take the index and I have another class that I want to bind to the inputs inside this *ngFor directive. See the code below:
<div
*ngFor="let plate of plates; index as i;">
<label class="form-control-plaintext"
for="plate{{i+1}}">{{i+1}}. Plate</label>
<div class="input-group">
<input id="plate{{i+1}}" type="text"
class="form-control"
name="plate{{i+1}}"
[(ngModel)]="car.plate{{i+1}}"/>
</div>
</div>
My problem is that I have 2 fields in Car type:
plate1?: string;
plate2?: string;
and I want to bind to these fields using *ngFor's index like car.plate{{i+1}} Is this possible?