Closed harshamadala closed 7 years ago
What version of angular are you using ?
looks like myApp.config(function (AnalyticsProvider) {
is not minifier-friendly ?
shouldnt you use myApp.config(['AnalyticsProvider', function (AnalyticsProvider) {
?
just realized this is written the same way on the README. can someone confirm the correct syntax for the config
block ?
@revolunet from the top of my head I would agree. I see no reason why config()
would behave differently when minified. @harshamadala could you try to copy the method syntax from run()
?
The problem is the 'run' method is configured incorrectly.
}).run(['Analytics'], function(Analytics) { });
That is not how DI declarations work in Angular. This should be:
}).run(['Analytics', function(Analytics) { }]);
Array declaration DI requires the function handler be the last item in the array. Angular was telling you that it found a string instead of a function as the last item in your array.
good catch @justinsa 👀
should we also fix the injection for AnalyticsProvider in the README ?
Thanks everyone for quick replies
Followed these stips but getting error "Argument 'fn' is not a function, got string"
I am getting error after doing 4th step. Am i doing anything wrong? Can anyone please help? Is there any version requirement for angular js?