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

.run-module-injection not working #24

Open
kristoffernolgren opened this issue Apr 3, 2014 · 1 comment
Open

.run-module-injection not working #24

kristoffernolgren opened this issue Apr 3, 2014 · 1 comment

Comments

@kristoffernolgren
Copy link

The most simplistic code I can use to test this is this:

angular.module('weather', ['ngRoute', 'angularytics']).
config(function($routeProvider, AngularyticsProvider){

AngularyticsProvider.setEventHandlers(['Console', 'GoogleUniversal']);

}).
controller...

working

but this:

angular.module('weather', ['ngRoute', 'angularytics']).
config(function($routeProvider, AngularyticsProvider){

AngularyticsProvider.setEventHandlers(['Console', 'GoogleUniversal']);

}).run(function(Angularytics){
Angularytics.init();
}).
controller....

not working. I get the following error:
Uncaught Error: [$injector:unpr] Unknown provider: AngularyticsConsoleHandlerProvider <- AngularyticsConsoleHandler <- Angularytics

@thomasplevy
Copy link

I was encountering this issue until I realized it was because I wasn't loading the consoleHandler.js file in the src directory of the repo, once I loaded that file the module began functioning.

I then realized that I really don't need the consoleHandler.js file (because it just logs stuff to the console for debug purposes) so I removed it from the setEventHandlers array and stopped loading the file.

Hope that helps!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants