I have a toogle that enables and disables a function, this already works, what does not work is the state of Toogle in the View, the toogle always stays enabled even with ngmodel = false. code below:
View:
<ion-toggle [(ngModel)]="Ativar" (ionChange)="SimNao()"></ion-toggle>
TS:
SimNao(){
if(this.Ativar == true){
this.storage.set('ativar', true);
}
if(this.Ativar == false){
this.storage.set('ativar', false);
}
}
Console
console.log(this.Ativar);
Both in the console and in the local storage the values are switched between True and False and in Local Storage everything is working, the function updates the data normally. The only problem is that toogle will always be enabled even if the state is false.