Giter Club home page Giter Club logo

Comments (3)

bramski avatar bramski commented on July 4, 2024

Sure. Feel free to open a PR. I'm otherwise uncertain when I'll get to
this as I'm not often using indexedDB in situations where it's not
supported!

On Saturday, October 25, 2014, James Messinger [email protected]
wrote:

Currently, the following lines are outside of the angular.module
definition, which means they run immediately when the file is loaded,
rather than waiting for angular.bootstrap to occur.

var IDBKeyRange, indexedDB,
__slice = [].slice;
indexedDB = window.indexedDB || window.mozIndexedDB || window.webkitIndexedDB || window.msIndexedDB;
IDBKeyRange = window.IDBKeyRange || window.mozIDBKeyRange || window.webkitIDBKeyRange || window.msIDBKeyRange;

The problem is that if I'm running in a browser that doesn't natively
support IndexedDB, and I'm loading a polyfill
https://github.com/axemclion/IndexedDBShim instead, then the above code
will only work if the polyfill is loaded before the
angular-indexed-db.js file. But if the polyfill is being loaded
dynamically (say, as an Angular module, a Require.js module, a Browserify
package, or a Cordova plugin), then the polyfill won't load in time, and
Angular-IndexedDB won't work.

To fix this problem, the four lines of code shown above just need to be
moved inside of the angular.module definition. That way, they won't run
until all dynamically-loaded scripts are finished loading and
angular.bootstrap is called.


Reply to this email directly or view it on GitHub
#4.

from angular-indexeddb.

JamesMessinger avatar JamesMessinger commented on July 4, 2024

Ok, will do. Just gotta get my Coffee Script set up first. :)

from angular-indexeddb.

bramski avatar bramski commented on July 4, 2024

Fixed. Closing.

from angular-indexeddb.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.