fredricrylander / angular-webstorage Goto Github PK
View Code? Open in Web Editor NEWWeb Storage Service Module for AngularJS
Web Storage Service Module for AngularJS
I am unable to get version 0.11.0 from bower
When checking for the existence of a key before setting a value, I get the an error, e.g.
console.log(webStorage.has('user'));
generates...
Uncaught TypeError: undefined is not a function
Am I missing something?
Session storage is, by design intended for potentially private data.
For this reason, it cannot be shared between tabs, or persist. And it is for this reason I think you should consider removing the cookie fallback for sessions storage. (or make it configurable)
Great work elsewhere by the way, great plugin!
https://github.com/fredricrylander/angular-webstorage/blob/master/angular-webstorage.js#L463 should check keys in sessionStorage, not localStorage
This would be useful to have on the Bower registry - perhaps you can add a Bower json manifest then bower register angular-webstorage https://github.com/fredricrylander/angular-webstorage.git
?
Will throw access denied exception when IE10 under Protected Mode on the code
if (!window.localStorage) {
Hi,
you should allow setting empty object as
webStorage.add('ordersList', {}, true);
Just update your doc (the code already works)
It would be useful to create a new version (tag) for the last merge, to reference from package.json.
If I try to reference your library from my package.json it doesn't find the package.json because it's not in version 0.14.0.
The bower.json is depending on the angular 1.0 or 1.1 which is much old, can you please change it to the newer version like 1.2.7? It's causing issue that bower always ask for conflict resolution when running bower install...
"dependencies": {
"angular": ">=1"
}
Just wondering - is localStorage always supported, since a fallback document.cookie implementation is provided if !window.localStorage:
https://github.com/fredricrylander/angular-webstorage/blob/master/angular-webstorage.js#L534-L576
If this actually is the case, I'd suggest replacing the 'memory' storage type with a new 'cookie' type, if document.cookie is always accessible (I'm not sure whether it is or not).
If there a reason you opted for add()
in the API? I personally think it should be set()
and get()
.
add()
almost implies its just for adding , and not updating as well.
I am trying to set the order of the storage.
Is there a way to do it as part of the angular app.config?
Example
var App = angular.module('App', ['webStorageModule']);
App.config(function ($routeProvider, webStorage, $httpProvider) {
webStorage.order('local', 'session', 'memory');
});
The module got 3 trailing commas of death that makes IE choke, on lines 161, 175, 189 and 190.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.