dimanche 3 décembre 2017

checkbox (click) angular 4 on dynamic checkbox creation

So I am dynamically creating checkboxes. What I want is for each checkbox to have a value which is dynamically created. On click of the checkbox I want the values of the checkbox to append to an array.

Here is what I am working on. Am I on track?

<div *ngFor="let cuisine of cuisines"
           class="col-md-10 col-md-offset-2 cuisineinput">

        <input type="checkbox"
               id=""
               name=""
               (click)="cuisineappend()"
               > 

      </div> <!--cuisine div -->

now Im getting an complaint on the (click)="cuisineappend()" it doesn't like that I am passing to the cuisineappend part. How would I pass the value?




Aucun commentaire:

Enregistrer un commentaire