Skip to content

Instantly share code, notes, and snippets.

@pankajpatel
Last active August 29, 2015 14:11
Show Gist options
  • Save pankajpatel/8ffdaa369e2cbaa42abe to your computer and use it in GitHub Desktop.
Save pankajpatel/8ffdaa369e2cbaa42abe to your computer and use it in GitHub Desktop.
Sample Angular Module File
angular
.module('storageModule', [])
.factory('store',['$window', function($window){
return {
setLocal: function( key, value ){
//code to store the key & value pair in localStorage
},
getLocal: function( key ){
//code to get the key stored in localStorage
},
setSession: function( key, value ){
//code to store the key & value pair in sessionStorage
},
getSession: function( key ){
//code to get the key stored in sessionStorage
}
}
}]);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment