I have some problem, in my Ionic app use toggle to switch on/off function. By default toggle is true, when toggle change it switch to false.
<ion-toggle ng-model="myToggle.checked" ng-change="myToggleChange()">
Toggle
</ion-toggle>
All work fine when use app, but if I close app and switch is false before closing when I load app again toggle has true by default when my controller start. How cache toggle after reload app has position before closing? Controller:
$scope.myToggleChange = function() {
if($scope.myToggle.checked == true){
console.log('Is True', $scope.myToggle.checked);
}
if($scope.myToggle.checked == false){
console.log('Is False', $scope.myToggle.checked);
}
};
$scope.myToggle = { checked: true };