0
I have a toggle that enables and disables a function, it already works, what does not work is the state of Toggle in the View, toggle is always activated 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 on the console and on-premise, the values are alternated between True and False and on Local Storage everything is working, the function updates the data normally. The only problem is that toggle is always enabled even if the state is false.
Activar
is aget Activar()
?– MoshMage
I wasn’t picking up at any point the value of this.Activate in the Path location, so the error persisted. But I was able to resolve.
– Anderson Costa