Hi,
I would like to know why the “change” event is not triggered when changing the toggle state. What am I missing?
html
<ion-item> <ion-label>Toggle state</ion-label> <ion-toggle [(ngModel)]="theSate" (change)="stateChange($event)" [checked]="_bState" yellow></ion-toggle> </ion-item>
ts
stateChange(event) { do something }
Thanks
I have the same problem. A workaround is to use the (click) event.
try to this (ionChange)="stateChange($event) instead (change)="stateChange($event)
[(ngModel)] is nothing but [ngModel] and (ngModelChange). So you could do this: <ion-toggle [ngModel]="theSate" (ngModelChange)="stateChange($event)" [checked]="_bState" yellow></ion-toggle>
<ion-toggle [ngModel]="theSate" (ngModelChange)="stateChange($event)" [checked]="_bState" yellow></ion-toggle>