Open JamesMessinger opened 9 years ago
Ahh yes. I had neglected to turn on issues in the other fork @BigstickCarpet. You should be able to make this issue over there now. Let me know if you cannot. I am happy to fix this issue, or you yourself may issue a pull request if you feel like contributing. Looks like a pretty simple fix. Cheers.
I know this project has been taken over by @bramski (https://github.com/bramski/angular-indexedDB), but GitHub won't let me post an issue on that fork, so I'm posting it here instead.
Currently, the following lines are outside of the
angular.module
definition, which means they run immediately when the file is loaded, rather than waiting forangular.bootstrap
to occur.The problem is that if I'm running in a browser that doesn't natively support IndexedDB, and I'm loading a polyfill 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 andangular.bootstrap
is called.