Select all for ion-checkbox

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 .


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

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.

do you have the answer ?