jeudi 5 juillet 2018

angular 5 binding checkbox checked to boolean

I am using angular 5 with typescript,

I have an object, containing an array of 4 booleans and i am trying to bind it to 4 checkboxes, It creates the form, but when I log the values of the array to the console they don't seem to change when I click the checkbox.

I use the following code in the html side

<label  *ngFor = "let v of options[0].options; let i = index">
    <input type="checkbox"  [value]=options[0].values[index]  [checked]=options[0].values[index] (click)="options[0].log()">
    
  </label>

What am i missing here?




Aucun commentaire:

Enregistrer un commentaire