I have a form which contain a list of checkboxes.
I want to display a form input in front of each checkbox when this checkbox is checked
This is my html :
<div class = "checkbox">
<label formArrayName="coverages" *ngFor="let coverage of coverageFormArray.controls;let i = index; let val of coverageFormArray.value;">
<input type="checkbox" kendoCheckBox [formControlName]="i"/>
{{coveragestypes[i]}}
<div *ngIf="val">
<input type = "text">
</div>
</label>
</div>
But here the form input is always displayed even the checkbox is checked or not! I think the problem is related to the directive ngFor where I put two loops let coverage of coverageFormArray.controls
and let val of coverageFormArray.value
? Can anyone help me please ?