Hey Guys,
seems to be a simple question, but i can’t figure out how this could be done.
I need a settings menu für my application and i worked with jQuery the whole time so ionic is new to me. I added a ion-toggle to my ion-content and i need the toggle to be activated when the user quits and restarts the application but first activated the option. Therefore i put the ng-change attribute onto my ion-toggle and set a true/false statement into my localStorage (1 and 0).
When my application launches i need to check, whether the state is set to 1 or 0 and if the state is one i need the toggle to look like activated.
Okay, i thought that this is easy but i don’t know where to place your snippet. I added it into my AppCtrl but it doesn’t change the toggle. It’s deactivated everytime i restart the application although the value in localStorage.airplaneMode is 1.