dimanche 17 février 2019

How to get all checkboxes values in angular material2 without using any kind of forms

I am building my checkboxes using ngFor:

 <ng-container *ngFor="let cb of (myList$ | async)">
      <mat-checkbox
        [value]="cb.name"
        [checked]="cb.checked"
        (change)="checkboxChange($event)" // only giving single value
        ></mat-checkbox
    </ng-container>

the (change)="checkboxChange($event)" giving only one single value but I am looking for all the checkboxes values.

Any ideas how to get all the checkboxes checked values without using any sort of forms?

Can not see anything like that in the docs https://material.angular.io/components/checkbox/overview




Aucun commentaire:

Enregistrer un commentaire