I want to validate the multiple looping of dynamic formControlName="xxx" in select field
My html code
<ul *ngFor="let detaillist of stressli.stresstabdetails;">
<li>
<div class="form-container">
<select [(ngModel)]="detaillist.stressname" class="form-control" formControlName="spotstressname {{q + 1 }}">
<option [ngValue]="undefined" selected>Select an option</option>
<option *ngFor="let item of stressdata;" [ngValue]="item">{{item}}</option>
</select>
</div>
</li>
</ul>
TS file validation:
this.CaseDetailsForm = this.formBuilder.group({
spotstressname1:['', Validators.required],
spotstressname2:['', Validators.required],
});
In .ts file I hardcoded the spotstressname1, spotstressname2, etc. Instead of hardcoded value I need dynamically as Output. How can I get that?