Hi can you help me, is there any solution how to save ng-show boolean vaue into the $ocalStorage or ngStorage?
I have an example of my code here but it’s not working, Please help me:
example.controller("ExampleController", function($scope,$localStorage) {
$localStorage.showDiv;
$scope.showPermanently = function(){
$scope.showMe = true; // set the ng-show value into true
$localStorage.showDiv = $scope.showMe; / /transfer the showMe value into ngStorage
}
$scope.hidePermanently = function(){
$scope.showMe = false; // set the ng-show value into true
$localStorage.showDiv = $scope.showMe;/ /transfer the showMe value into ngStorage
}
});
<ion-content ng-controller="ExampleController">
<br><br><br>
<button class="button" ng-click="hidePermanently()">Hide Permanently</button>
<button class="button" ng-click="showPermanently()">Show Permanently</button>
<div ng-show="showMe">
Hi I'm Saved Permanently !
</div>
</ion-content>