Paul
Paul

Reputation: 26670

Angular.js: make variables survive page reload

Which methods could be used with Angular.js to make $rootScope.myVar variable survive page reload except putting it to cookies or retrieving from server periodically with a $http request?

Upvotes: 2

Views: 721

Answers (1)

Ben Lesh
Ben Lesh

Reputation: 108491

Why not use some sort of local storage wrapper like Lawnchair JS? It's got an adapter pattern so you can hook it up to whatever you like, but it defaults to local storage.

Upvotes: 3

Related Questions