lundi 17 juillet 2017

How to attach ngModel with dynamic number of checkboxes in Angular?

I have a list which contains dynamic number of checkbox's, each is having id attribute.

<li *ngFor='let i of someArray'>
<input type="checkbox" id=>
</li>

I can assign each input checkbox if they are known previously by [(ngModel)] to those many number of variables.

But how to attach dynamic number of checkbox's with variables while preserving the concept of Two-Way binding.

I am using @angular/core 2.4.10.

Aucun commentaire:

Enregistrer un commentaire