jmdobry / angular-cache

angular-cache is a very useful replacement for the Angular 1 $cacheFactory.
http://jmdobry.github.io/angular-cache
MIT License
1.39k stars 156 forks source link

requirejs conflict, require object overwritten #127

Closed grokcore closed 10 years ago

grokcore commented 10 years ago

In the dist/angular-cache.js file you have require=(function e(t,n,r)... which, due to being set on the global level causes the usual require object to be overwritten with the closure's return value.
As far as I can tell (in my dev environment), the LH assignment isn't required and simply removing it fixes the problem.

jmdobry commented 10 years ago

That code is generated by browserify. What is the usual require object?

grokcore commented 10 years ago

Hi - Thanks for replying. As in window.require, since there's no closure. Is browserify used with angular-data? It's all in a full closure in that project. It causes an issue primarily with AngularAMD in this case, when the bootstrap is called, require is no longer what it was.

On Thu, Aug 28, 2014 at 3:11 PM, Jason Dobry notifications@github.com wrote:

That code is generated by browserify. What is the usual require object?

— Reply to this email directly or view it on GitHub https://github.com/jmdobry/angular-cache/issues/127#issuecomment-53780286 .

jmdobry commented 10 years ago

I use grunt-browserify to build both angular-data and angular-cache. It's strange they aren't consistent with each other. I'll investigate.

jmdobry commented 10 years ago

Fixed in 3.1.1.