An AngularJS module that provides a service to access the browser's local storage and session storage with a consistent API, fallback to cookies when storage is not supported, and support for prefixes to avoid key collisions. Version 0.7.1 is the latest stable release; the package is in maintenance mode with no active development. Key differentiators: integrates directly with AngularJS (1.x), provides cookie fallback, supports prefix and storage type configuration via provider. Not suitable for modern Angular (2+).
npm install angular-local-storageNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Basic usage of localStorageService in an AngularJS controller: set, get, remove, clearAll.
Use a modern local storage wrapper like @ngx-pwa/local-storage or native localStorage with Angular services.
Disable cookie fallback by setting setDefaultToCookie(false) if you don't need it, or ensure storage is supported.
Always use string keys explicitly.
Use JSON-safe values or implement custom serialization.
Ensure 'LocalStorageModule' is added to your app's dependency list and the angular-local-storage script is loaded after angular.js.
Inject 'localStorageService' as a dependency in your controller function: function($scope, localStorageService) { ... }Use localStorageServiceProvider only inside angular.module('myApp').config(function(localStorageServiceProvider) { ... });