I am trying to retrieve all the checked values from a checkbox list in an Ionic3 app when clicked. Below is the code snippet:
<ion-content padding>
<ion-list>
<ion-item *ngFor="let item of items; let i= index">
<ion-label>{{item.name}}</ion-label>
<ion-checkbox [(ngModel)]="checkedItems[i]" (ionChange)="do_something()"></ion-checkbox>
</ion-item>
</ion-list>
</ion-content>
Here's the associated JavaScript function:
do_something() {
console.log(this.checkedItems);
}