Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Does not work with Angular 1.3 and browserify #204

Closed
jukkasi opened this issue Oct 22, 2015 · 5 comments
Closed

Does not work with Angular 1.3 and browserify #204

jukkasi opened this issue Oct 22, 2015 · 5 comments
Assignees

Comments

@jukkasi
Copy link

jukkasi commented Oct 22, 2015

I'm using Angular 1.3.20 which is now CommonJS compatible (since 1.3.14).

When I use browserify require('angular-cache') var angular is undefined in your module. This leads to error "angular.module is undefined"

Similar issue has been discussed here likeastore/ngDialog#168 but please note that discussion started BEFORE Angular 1.3.14 and CommonJS changes.

Changing angular-cache.js

if(typeof exports === 'object' && typeof module === 'object') 
    module.exports = factory(require("angular"));

to

if(typeof exports === 'object' && typeof module === 'object')
    module.exports = require("angular");

fixes the issue.

Working example is probably https://github.com/likeastore/ngDialog/blob/master/js/ngDialog.js

@jukkasi
Copy link
Author

jukkasi commented Nov 3, 2015

Any ideas? Would be actually nice to use this library.

Otherwise I'm forced to fork and remove the UMD stuff

jukkasi pushed a commit to jukkasi/angular-cache that referenced this issue Nov 3, 2015
@mchambaud
Copy link

@jukkasi can you create a pull-request with this fix?

@mchambaud
Copy link

Can we get this into angular-cache?!

@SatadruBhattacharjee
Copy link

+1

@jmdobry
Copy link
Owner

jmdobry commented Apr 29, 2016

Fixed by b491ed83

@jmdobry jmdobry closed this as completed Apr 29, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants