here is my .html file
<ion-item no-lines (click)="update()" >
<ion-label> Notification</ion-label>
<ion-toggle [(ngModel)]="notify" ></ion-toggle>
</ion-item>
the above code works when i click on the Notification
text but when i click on the ion-toggle
i am not able to invoke the function what should i do to invoke the function.
here is my .ts file
update(){
console.log("invoking notification");
}
If you use ngModel
it's best to use ngModelChange
<ion-toggle [(ngModel)]="notify" (ngModelChange)="update($event)" ></ion-toggle>
otherwise you can use
<ion-toggle (ionChange)="update($event)"></ion-toggle>
See also https://ionicframework.com/docs/api/components/toggle/Toggle/