Registry / storage / angular-storage

angular-storage

JSON →
library0.0.15jsnpmunverified

Store wrapper for AngularJS that defaults to localStorage/sessionStorage and falls back to ngCookies. Version 0.0.15 is the latest stable release (no recent updates). Saves and retrieves JavaScript objects, numbers, and strings with type preservation. Features caching to avoid redundant reads and supports namespaced stores. Designed for AngularJS (1.x) applications.

npm install angular-storage
INSTALL
IMPORT
SIG · ANGULAR-STORAGE
A
angular-storage
storagejavascriptv0.0.15
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

store
import { store } from 'angular-storage';
const store = require('angular-storage');
CommonJS require returns module object, but store is a service; use ESM or inject via AngularJS dependency injection.
storeProvider
import { storeProvider } from 'angular-storage';
const storeProvider = require('angular-storage');
storeProvider is used for configuration; similar import pattern as store.
angular.module('app', ['angular-storage'])
angular.module('app', ['angular-storage']);
angular.module('app', ['a0-angular-storage']);
The module name is 'angular-storage' (not the Bower package name 'a0-angular-storage').

Demonstrates basic usage: set, get, and type preservation with angular-storage in AngularJS.

var app = angular.module('app', ['angular-storage']); app.controller('Controller', function(store) { store.set('version', 42); var version = store.get('version'); console.log(typeof version); // 'number' });
Debug
Known issues
gotchaService name 'store' conflicts with other libraries (e.g., Redux store).
fix
Rename via AngularJS decorator or avoid using in contexts where store is ambiguous.
affects: all
deprecatedPackage is unmaintained; no updates since 2016. AngularJS (1.x) ecosystem is in maintenance mode.
fix
Migrate to a modern storage solution for Angular (2+) or native localStorage API.
affects: >=0.0.15
gotchaFalls back to ngCookies when localStorage/sessionStorage unavailable, which may expose data in HTTP headers.
fix
Ensure cookies are not used for sensitive data; consider other fallback strategies.
affects: all
gotchaNamespaced stores use a delimiter that defaults to '.', which may conflict with dot-notation in keys.
fix
Explicitly set a different delimiter (e.g., ':') when creating namespaced stores.
affects: all
Errors
Common errors & fixes
Module 'angular-storage' is not available!
Missing script inclusion or wrong module name in angular.module dependencies.
fix
Include the script tag for angular-storage.js and use angular.module('app', ['angular-storage']).
TypeError: Cannot read property 'get' of undefined
store service not injected correctly in controller/directive.
fix
Inject 'store' into the controller function: function($scope, store) { ... }
ReferenceError: store is not defined
Using store outside of AngularJS's dependency injection scope (e.g., in plain JavaScript).
fix
Access store only within components managed by AngularJS (controllers, services, etc.).
Upgrade
Version history
0.0.15latest on npm
Audit
Dependencies
angularrequiredPeer dependency for AngularJS (1.x) integration.
Agent activity
43 hits · last 30 days
node
36
OpenAI (training)
1
Resources
angular-storage — npm install angular-storage · libregistry