Ion toggle issue

#1

i got an issue with ion toggle.
i just want, if a validation is false, so toggle get back to false, until validation is true.
here is my code
.html

.ts

i don’t know if im doing an stupid question or what. :frowning:

#2

Try change (ngModelChange)=“toggleClick()”

(ionChange)="toggleClick()"

#3

(ionChange) enters in a infinite loop :frowning:

#4

Just let the ng model and make the validation in other funtion, probably the function that returns your api response.

#5

solved:

image

adding the attribute checked and changing it on .ts , it work :wink: