samedi 6 avril 2019

How to use *Ngfor in an other *Ngfor

I am trying to create a checkbox for each element of an array "lesCriteres". Then I want each of these checkboxes to be checked if its value is in the table "actif.lesCriteresActifs"

Here is the code I want but it does not work as I want

<div class="checkbox-inline" *ngFor="let l of lesCriteres">
    <div *ngFor="let a of actif.lesCriteresActifs; let i=index">
        <label></label>
        <input type="checkbox" (change)="onChangeEvent(l.code, $event.target.checked)" [checked]="actif.lesCriteresActifs[i]?.critere.code==l.code"> <br>
     </div>
</div>




Aucun commentaire:

Enregistrer un commentaire