-
Notifications
You must be signed in to change notification settings - Fork 27.4k
Loader isn't working when adding ng-resource (and others) #9140
Comments
Having the same behaviour with ui-router |
can you post your bower.json? |
Sure thing! here you have
|
Thank you. Can you have a look at the actual versions of each angular module in your bower_components directory and report them here? I have a feeling this is an issue with inconsistent versions, but it's hard to verify. We don't actually do any QA on angular-loader, so it's possible we broke something between 1.2.0 and now, however that should have affected you fora long time if we did |
The thing is that I changed to angular-loader just a few days ago.. :) Here you have the list of versions angular: * v1.2.25 Also, if you don't run QA on angular-loader, would it be safe to use it? I mean do you recommend it for production? Thanks a lot!!! |
Hi there, sorry to bother but is there any update on this one? Happy to test, check, what ever you need. Thanks! |
It seems that the problem is only with Chrome (37.0.2062.122), FF (32.0.2) and Safari (7.0.6 (9537.78.2)) seems to be working fine. |
@mustela Did the problem disappear in newerChrome versions? |
@Narretz yes having the same issue. |
I am having the issue with
|
This is because most ng-x modules assign some helper functions of angular core, like angular.isFunction or angular.$$minErr to new variables for easier access right at the start of their closure. If all files are loaded async, it's possible that for example angular-animate is loaded before angular.js and then window.angular is undefined. I would suggest that we change angular-seed to always load angular.js in sync. Otherwise, we'd have to refactor the modules to never reassign core angular functions in the initial closure. |
If you are using an async script loader, the workaround I would recommend for now is to always load the main angular.js first, then afterwards load all other files in parallel. |
(Previous commits fixed angular#9140.) Closes angular#9140
…ular-loader` Some modules used to assume that the angular helpers would always be available when their script was executed. This could be a problem when using `angular-loader` and the module file happened to get loaded before the core `angular.js` file. This commit fixes the issue by delaying the access to angular helpers, until they are guaranteed to be available. Affected modules: - `ngAnimate` - `ngMessageFormat` - `ngMessages` - `ngRoute` - `ngSanitize` Fixes #9140 Closes #14794
I'm using the last angular version (1.2.25), and using angular-loader, but it seems that isn't working when trying to load ngresource, or ng-sanitize (and others).
I've tested it using angular-seed (using aync index) to see if it was working there, but having the same results:
The text was updated successfully, but these errors were encountered: