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

Answer by Sunil Lama for angular - local storage not working

$
0
0

Just use localStorage not $localStorage cause $localStorage has to be injected whereas localStorage comes by default in angularjs and it works without you having to inject anything. I have worked on it.

$ionicPlatform.ready(function() {    localStorage.message = "whatever";});

In Controller:

$scope.message = localStorage.message;

In View:

<div>{{message}}</div>

Viewing all articles
Browse latest Browse all 7

Trending Articles



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