There are two methods for validation.
The first one follows the suggestion from @Chathuranga Silva
html
<ion-toggle (ionChange)="check($event)"></ion-toggle>
ts
check(event: any) { console.log("toggled: "+event.target.checked); }
The second method looks like this:
html
<ion-toggle (ionChange)="check()" [checked]="isChecked"></ion-toggle>
ts
var isChecked: boolean = true;
check() {
console.log("toggled: "+ this.isChecked);
}
The choice between the two is yours, but I suggest the second option as it allows for easier manipulation of the toggle in the constructor/onInit and makes it simpler to utilize this value outside of the check()
function.