Strange $injector error on module load
See original GitHub issuevar myApp = angular.module("myApp", ['tmh.dynamicLocale']);
As soon as the module is included into my app’s module this error gets thrown:
Uncaught Error: [$injector:unpr] Unknown provider: $rootScopeProvider <- $rootScope <- tmhDynamicLocale
Libraries:
- Angular 1.2.16
- angular-dynamic-locale 0.1.9
edit
I removed the .run(['tmhDynamicLocale', angular.noop]);
from the module and now it seems to be working.
Issue Analytics
- State:
- Created 9 years ago
- Comments:10 (5 by maintainers)
Top Results From Across the Web
Getting a strange injector error - Unknown provider: bProvider
After compiling my code, I'm getting a strange error that I don't recognize. Usually with an $injector error I get a specific module...
Read more >NullInjectorError: StaticInjectorError(AppModule) for lazy ...
We use loadChildren to target the wrapper module from the app so it loads the feature module from the package. But when we...
Read more >Uncaught Error: [$injector:nomod] Module 'TodoListApp' is not ...
Maybe the flow of scripts gets interrupted by this and something weird happens.At a first glance the app looks fine and should work....
Read more >angularjs + datatables directive throwing Error: $injector
We're running through a very strange error when using angularjs to load data from server. The data were loaded correctly but as we've...
Read more >What you always wanted to know about Angular Dependency ...
Some time ago, when lazy loaded modules started to be widely used, one strange behavior was reported on github: dependency injection system caused...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I just ran into this issue too. Turns out it was user error.
When injecting, I used:
instead of
(There is an extra dot in the 1st version).
It’s a bit confusing, because the name of the module is ‘tmh.DynamicLocale’ (with a dot), but the name of the exposed service is ‘tmhDynamicLocale’
Ok, thanks for the feedback. Closing this now, but if you run into this issue again, please feel free to reopen it