Select all for ion-checkbox


#1

Hi am new to ionic and to this forum too. I am trying to get a select all option (and deselect) working in . I am not using .

html:

<ion-item>
    <ion-checkbox [(ngModel)]="SelAll" (click)="SelectAll()"></ion-checkbox>
    <ion-label>Select All</ion-label>
</ion-item>
<ion-item *ngFor="let dept of this.departments">
    <ion-checkbox></ion-checkbox>
    <ion-label>{{dept.name}}</ion-label>
</ion-item>

I am not sure what to have in the SelectAll() method in the ts file. I want everything in the same page and io-select takes me to a pop up, hence avoiding it.