All Projects → auth0 → Angular Storage

auth0 / Angular Storage

Licence: mit
A storage library for AngularJS done right

Programming Languages

javascript
184084 projects - #8 most used programming language

Labels

Projects that are alternatives of or similar to Angular Storage

Invenio
Invenio digital library framework
Stars: ✭ 469 (-28.51%)
Mutual labels:  angularjs
Abixen Platform
Abixen Platform
Stars: ✭ 530 (-19.21%)
Mutual labels:  angularjs
Eslint Plugin Angular
ESLint plugin for AngularJS applications
Stars: ✭ 607 (-7.47%)
Mutual labels:  angularjs
Angular Translate
Translating your AngularJS 1.x apps
Stars: ✭ 4,414 (+572.87%)
Mutual labels:  angularjs
Angular Recaptcha
AngularJS directive to add a reCaptcha widget to your form
Stars: ✭ 502 (-23.48%)
Mutual labels:  angularjs
Springboot Jwt Starter
A Spring Boot JWT starter kit for stateless and token-based authentication apps.
Stars: ✭ 538 (-17.99%)
Mutual labels:  angularjs
Meantorrent
meanTorrent - MEAN.JS BitTorrent Private Tracker - Full-Stack JavaScript Using MongoDB, Express, AngularJS, and Node.js, A BitTorrent Private Tracker CMS with Multilingual, and IRC announce support, CloudFlare support. Demo at:
Stars: ✭ 438 (-33.23%)
Mutual labels:  angularjs
Heatmap.js
🔥 JavaScript Library for HTML5 canvas based heatmaps
Stars: ✭ 5,685 (+766.62%)
Mutual labels:  angularjs
Angular Socialshare
Angular social share module, share urls and content on social networks such as facebook, google+, twitter, pinterest and more ... - http://720kb.github.io/angular-socialshare
Stars: ✭ 508 (-22.56%)
Mutual labels:  angularjs
Ionic Native Transitions
[Maintenance only] Native transitions (iOS & Android) for Ionic Framework
Stars: ✭ 589 (-10.21%)
Mutual labels:  angularjs
Angular Datepicker
Angularjs datepicker module, generate a datepicker on your input element - https://720kb.github.io/angular-datepicker
Stars: ✭ 486 (-25.91%)
Mutual labels:  angularjs
Faqguru
🎒 🚀 🎉 A list of interview questions. This repository is everything you need to prepare for your technical interview.
Stars: ✭ 4,653 (+609.3%)
Mutual labels:  angularjs
Angularjs Style Guide
📚 Community-driven set of best practices for AngularJS application development
Stars: ✭ 5,037 (+667.84%)
Mutual labels:  angularjs
Angular Css
CSS on-demand for AngularJS [Looking for New Maintainers]
Stars: ✭ 481 (-26.68%)
Mutual labels:  angularjs
Angular Form Builder
Drag and drop to build bootstrap forms in AngularJS.
Stars: ✭ 607 (-7.47%)
Mutual labels:  angularjs
Nghandsontable
Official AngularJS directive for Handsontable
Stars: ✭ 438 (-33.23%)
Mutual labels:  angularjs
Gulp Angular Templatecache
Concatenates and registers AngularJS templates in the $templateCache.
Stars: ✭ 530 (-19.21%)
Mutual labels:  angularjs
Ionic Datepicker
'ionic-datepicker' bower component for ionic framework applications
Stars: ✭ 652 (-0.61%)
Mutual labels:  angularjs
Guides
Article back-end for hack.guides() website
Stars: ✭ 628 (-4.27%)
Mutual labels:  angularjs
Learning Resources
"Technology Gold mine" to collect and share materials/resources
Stars: ✭ 573 (-12.65%)
Mutual labels:  angularjs

angular-storage Build Status

A Storage done right for AngularJS.

Sponsor

auth0 logo If you want to quickly add secure token-based authentication to your Angular projects, feel free to check Auth0's Angular SDK and free plan at auth0.com/developers

Key Features

  • Uses localStorage or sessionStorage by default but if it's not available, it uses ngCookies.
  • Lets you save JS Objects
  • If you save a Number, you get a Number, not a String
  • Uses a caching system so that if you already have a value, it won't get it from the store again.

Installing it

You have several options: Install with either bower or npm and link to the installed file from html using script tag.

bower install a0-angular-storage
npm install angular-storage

Using it

angular.module('app', ['angular-storage'])
.controller('Controller', function(store) {
  var myObj = {
    name: 'mgonto'
  };

  store.set('obj', myObj);

  var myNewObject = store.get('obj');

  angular.equals(myNewObject, myObj); // return true

  store.remove('obj');

  store.set('number', 2);

  typeof(store.get('number')) === 'number'
});

Namespaced Storages

You can also create namespaced storages if you want

angular.module('app', ['angular-storage'])
.factory('Auth0Store', function(store) {
  return store.getNamespacedStore('auth0');
})
.controller('Controller', function(Auth0Store) {

  var myObj = {
    name: 'mgonto'
  };

  // This will be saved in localStorage as auth0.obj
  Auth0Store.set('obj', myObj);

  // This will look for auth0.obj
  var myNewObject = Auth0Store.get('obj');

  angular.equals(myNewObject, myObj); // return true
});

Changing storage type

angular.module('app', ['angular-storage'])
  .config(function(storeProvider) {
    // Store defaults to localStorage but we can set sessionStorage or cookieStorage.
    storeProvider.setStore('sessionStorage');
  })
  .controller('Controller', function(store) {

  var myObj = {
    name: 'mgonto'
  };

  // This will be saved in sessionStorage as obj
  store.set('obj', myObj);

  // This will look for obj in sessionStorage
  var myNewObject = store.get('obj');

  angular.equals(myNewObject, myObj); // return true
});

API

storeProvider.setStore(storageName)

Sets the underlying store for the store service. It can be localStorage, sessionStorage or cookieStorage. Defaults to localStorage

store.set(name, value)

Sets a new value to the storage with the key name. It can be any object.

store.get(name)

Returns the saved value with they key name. If you saved an object, you get an object.

store.remove(name)

Deletes the saved value with the key name

store.getNamespacedStore(namespace, delimiter)

Returns a new store service that will use the namespace and delimiter when saving and getting values like the following namespace[delimiter]key. For example auth0.object considering auth0 as namespace and . as a delimiter

Usages

This library is used in auth0-angular

Contributing

Just clone the repo, run npm install, bower install and then gulp to work :).

Issue Reporting

If you have found a bug or if you have a feature request, please report them at this repository issues section. Please do not report security vulnerabilities on the public GitHub issue tracker. The Responsible Disclosure Program details the procedure for disclosing security issues.

Author

Auth0

License

This project is licensed under the MIT license. See the LICENSE file for more info.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].