I have an Onsen-UI Switch. I switch it on, then navigate away from the page. When I return to the page, the switch has changed to off; the switch has not remembered it's state? I am also having trouble coding the Switch so it calls a function on Switch changed. I've read the Onsen Docs and searched online, but I cannot find a clearly coded example to achieve the above.
<label class="switch">
<input type="checkbox" var="switchName" ng-model="switchState" ng-change="switchChanged()" class="switch__input">
<div class="switch__toggle"></div>
</label>
Script
function switchChanged() {
if ($scope.switchState == true) {
// Switch to saving app data into Production Database
} else {
// Switch to saving app data into Developer Database
};
};
Thank you for any help.