Are there any plans to support a way to access/modify/map the html5 localStorage and sessionStorage from within Bootstrap/AngularJS projects?
Are there any plans to support a way to access/modify/map the html5 localStorage and sessionStorage from within Bootstrap/AngularJS projects?
Hello Chris,
This is not planned for Bootstrap/AngularJS projects at this moment, as scope variables implement this logic for Bootstrap/AngularJS.
Hi Alena,
If that is the case, what is the recommended way to persist data?
Between different pages/views in the same session
Between new sessions
I know angular has $cookie, but it doesn't seem robust enough for medium to large amounts of data (large json strings in my case) which should be persisted between sessions.
1) First of all, we should add scope variable, which generate something like this:
pre$scope.session_token = Apperyio.EntityAPI('string');/pre
2) Then, in ng-init method, by using snippet we create watcher for this variable:
pre$scope.$watch( 'session_token', function(newValue, oldValue){
Apperyio.configAdd( 'SESSION_TOKEN', newValue );
});/pre
3) Use $scope.session_token variable in mapping
4) On next screen user just read it from settings:
pre$scope.session_token_copy = Apperyio.config( 'SESSION_TOKEN' );/pre
Hi Sergiy,
Where can i find documentation on the code you use above?
I've been trying to find it with no luck.
Thanks!
Hi Argia -
We are working on our documentation and we will update our AngularJS section in near time.
The code that Sergiy provided are all AngularJS concepts.
Hi Alena,
What about persisting data beyond sessions (which currently happens via localStorage), what is the recommended method using the Bootstrap/AngularJS tools?
Use;
localStorage.setItem("name", value);
Its not visible in the Appery IDE but it's working