0

I have initialized my controller as :

(function (module) {
  myApp.controllers = _.extend(module, {
    MyController : function (scope, resourceFactory, http, location ) {

I am getting this error in the console:

[ng-areq]Argument 'MyController' is not a function, got undefined

What am I missing? What is the fix?

Any help would be appreciated!

Thanks!

Vega
  • 27,856
  • 27
  • 95
  • 103

1 Answers1

0

After a lot of tinkering, I came up with an solution i.e the sequence in which you initialize scope, and other dependencies is very important! Always initialize dependencies in the sequence in which they will be interpreted f.ex, $scope, $resource here I have initialized scope then resource but if i do this $scope, $log, $resource and then I use resource it will show up an error like mentioned in the question!

Regards