An AngularJS module that gives you access to the browsers local storage with cookie fallback. You can install angular-local-storage using 3 different ways. For local testing (when you are testing on localhost) set the domain to an empty string ''. Setting the domain to 'localhost' will not work on all browsers (eg. Chrome) since some browsers only allow you to set domain cookies for registry-controlled domains, i.e. something ending in .com or so, but not IPs or intranet hostnames like localhost. Configure whether events should be broadcasted on $rootScope for each action. You can also dynamically change storage type by passing the storage type as the last parameter for any of the API calls.
Features
- You could set a prefix to avoid overwriting any local storage variables from the rest of your app
- You could change web storage type to localStorage or sessionStorage
- Set cookie options (usually in case of fallback)
- If localStorage is not supported, the library will default to cookies instead
- Change the local storage prefix during execution Returns
- You can also dynamically change storage type by passing the storage type as the last parameter for any of the API calls
License
MIT LicenseFollow angular-local-storage
You Might Also Like
MongoDB Atlas runs apps anywhere
MongoDB Atlas gives you the freedom to build and run modern applications anywhere—across AWS, Azure, and Google Cloud. With global availability in over 115 regions, Atlas lets you deploy close to your users, meet compliance needs, and scale with confidence across any geography.
Rate This Project
Login To Rate This Project
User Reviews
Be the first to post a review of angular-local-storage!