AngularJS Session Storage ngStorage

AngularJS Session Storage ngStorage

Today, We want to share with you AngularJS Session Storage ngStorage.
In this post we will show you AngularJS Session Storage ngStorage, hear for AngularJS Session Storage ngStorage we will give you demo and example for implement.
In this post, we will learn about AngularJS Session Storage ngStorage with an example.

step by step example of Save data and Retrieve data from (javascript)HTML5 LocalStorage using and SessionStorage using AngularJS example

READ :  Angular ng-focus Directive Set Focus on Textbox

There are following list of Contains two services: 1) $localStorage 2) $sessionStorage.
sessionStorage – you got all this always-overlooked buddy data covered.

LocalStorage and SessionStorage made easy in AngularJs Example

index.html

[php]

:#/infinityknow

www.infinityknow.com


Session Storage Example with AngularJS

Hello, {{message}}!

[/php]

App.js

[php]
var liveApp = angular.module(‘liveApp’,[]);

function liveCtrl($scope,$window) {

//Same as Cookies SAVE VAUE
$window.sessionStorage.setItem(“tableRkey”,”I’m a value (infinityknow.com) saved with SessionStorage”);

//Same as Cookies RETRIEVE VALUE
$scope.message = $window.sessionStorage.getItem(“tableRkey”);

}
[/php]

Style.css

[php]
header{
font-size:30px;
text-align:center;
margin:30px;
padding:10px;
}

.title{
font-size:40px;
color:green;
}

#container{
text-align:center;
margin:10px;
padding:30px;
}
[/php]

angularjs ngstorage example

ngStorage using | localStorage and sessionStorage done all the right for AngularJS

[php]

http://angular.min.js
http://ngStorage/master/ngStorage.js

READ :  Laravel Sending Email setup configuration step by step

angular.module(‘liveApp’, [
‘ngStorage’
]).

controller(‘liveCtrl’, function(
$scope,
$localStorage
){
$scope.$storage = $localStorage.$default({
x: 41
});
});

AngularJS Session Storage Example – ngStorage

+ = {{$storage.x + $storage.y}}

[/php]
Example

Example

We hope you get an idea about AngularJS Session Storage ngStorage
We would like to have feedback on my Information blog .
Your valuable any feedback, Good question, Inspirational Quotes, or Motivational comments about this article are always welcome.
If you liked this post, Please don’t forget to share this as Well as Like FaceBook Page.

We hope This Post can help you…….Good Luck!.

Leave a Comment