jeudi 4 avril 2019

how to specify the value of our checkbox

I want that when the user checks on checkbox, the value be "l.code" instead of a Boolean value

Here's my code

<div class="form-group">
    <label>Critères : </label>&nbsp;
    <div class="checkbox-inline" *ngFor="let l of lesCriteres; let i= index">
      <label>
        <input type="checkbox" [value]="l.code" [(ngModel)]="actif.lesCriteresActifs[i].critere.code">
      </label>
    </div>
</div>

But it does not work ! when I check, it gives me "true" instead of "l.code". Thanks !




Aucun commentaire:

Enregistrer un commentaire