Quantcast
Channel: angular - local storage not working - Stack Overflow
Viewing all articles
Browse latest Browse all 7

Answer by Prasad for angular - local storage not working

$
0
0

As per documentation :-

 var app = angular.module('app', ['ngStorage'])    .config(['$localStorageProvider',        function ($localStorageProvider) {            $localStorageProvider.get('MyKey');//gets            $localStorageProvider.set('MyKey', { k: 'value' });/sets        }]);

Or

 localStorage.setItem('message', 'helloworld');//saves in developer tools $scope.getItem=localStorage.getIem('message');

Viewing all articles
Browse latest Browse all 7

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>