Comments (6)
Could you do me a plunkr (or something similar) with the problem ? I'm not really good with requirejs and that would help me.
But as you explain it, it seems to be a bug with localforage more than with angular-localforage ?
from angular-localforage.
Sure. http://plnkr.co/edit/91UCt2E4OeFP6USpBeAH
(First time using plnkr, so tell me if it's not OK)
If you check the console you will find something like this:
Error: [$injector:modulerr] Failed to instantiate module LocalForageModule due to:
TypeError: Cannot read property 'config' of undefined
at new <anonymous> (http://run.plnkr.co/RzZL8eJP9kWNJN0p/angular-localForage.js:13:14)
at invoke (http://cdnjs.cloudflare.com/ajax/libs/angular.js/1.2.20/angular.js:3918:17)
at Object.instantiate (http://cdnjs.cloudflare.com/ajax/libs/angular.js/1.2.20/angular.js:3929:23)
at provider (http://cdnjs.cloudflare.com/ajax/libs/angular.js/1.2.20/angular.js:3785:36)
at Object.provider (http://cdnjs.cloudflare.com/ajax/libs/angular.js/1.2.20/angular.js:3777:16)
at http://cdnjs.cloudflare.com/ajax/libs/angular.js/1.2.20/angular.js:3837:37
at Array.forEach (native)
at forEach (http://cdnjs.cloudflare.com/ajax/libs/angular.js/1.2.20/angular.js:325:11)
at loadModules (http://cdnjs.cloudflare.com/ajax/libs/angular.js/1.2.20/angular.js:3824:5)
at http://cdnjs.cloudflare.com/ajax/libs/angular.js/1.2.20/angular.js:3831:40
This is because window.localforage is undefined, due the AMD style loading.
About if it's a bug with localforage, I think yes and no. In my opinion Localforage should provide something like .noConflict() method on jQuery to keep running with plugins without AMD support, but plugins should support AMD / CommonJS as well to be consistent.
from angular-localforage.
Sorry about letting this without an answer.
It seems that in 1.0 of localforage they changed the support for requireJS:
In pre-1.0 versions you had to call .ready() to make sure the code was loaded, but this is no longer necessary.
It may be working now, I'll test once I've updated the code to support 1.0.
from angular-localforage.
The version 1.0 has been released, do you still have the problem ?
from angular-localforage.
You're taking about localForage/localForage#182 right? Seems that require.js support on localforage was broken anyway.
However, the problem is still there as long as the code references window.localforage. We need to use AMD or Node style loading if the user is using it to keep this working.
I made a fix for this and I think it solves it all, but I have almost no idea about node so I can't try that part. AMD and regular loading work OK.
On the other hand I'm having some issues when running the tests because I'm getting some "Not authorized" errors on sauce connect. Do I need some credentials for it or something?
from angular-localforage.
Thanks for the PR! I'll test it and let you know.
Sauce labs credentials are not well configured on this repo, I need to change those, it's not your fault :-)
from angular-localforage.
Related Issues (20)
- Versioning DB HOT 3
- Bump localForage to 1.4.2
- Clean up and update depedencies HOT 1
- Support passing back an object on multi-getItem lookup
- import/require should return module name HOT 6
- question: angular-localForage support indexedDB, webSQL, localstorage, but i don't know which one it is the default choice HOT 1
- Q: Is there the maximun about angular-localForage HOT 1
- does bind() a two way binding? HOT 4
- Change dependencies from dist to source? HOT 4
- Using directive and deleting value keeps 3 characters in the field HOT 5
- Storing huge object freeze my app HOT 9
- Use getItem instead of iterate for small getItem array lookups HOT 2
- Facebook In-App Browser HOT 6
- $$hashKey is now being saved on setitem HOT 8
- i get this error when i'm tring to use electron app with angular-localforage HOT 5
- Correct usage with webpack HOT 3
- iOS safari support indexedDB HOT 6
- Support for AngularJs 1.6! HOT 4
- Nested Promises do not work HOT 3
- setItem call does not return an angular promise but an ES6 promise HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from angular-localforage.