AngularJS/Jade Error: Argument 'MyController' is not a function, got undefined (MEAN)

后端 未结 2 403
甜味超标
甜味超标 2021-01-04 23:54

I know variations of this question have already been asked several times, but I\'ve tried several suggested solutions for other OPs, haven\'t been able to resolve this, and

相关标签:
2条回答
  • 2021-01-05 00:20

    This error mostly comes when angularjs is not able to locate the controller in any module. This can happen when you accidentally redefine the module. In your case i see that

    window.app = angular.module('mean', ['ngCookies', 'ngResource', 'ui.bootstrap', 'ui.route', 'mean.system', 'mean.articles' ]);

    and then

    var mean = angular.module('mean',[]);

    This syntax redefine the module.

    To get the existing module using angular.module('mean') without the second parameter.

    0 讨论(0)
  • 2021-01-05 00:38

    I just had this issue now. I tried all the suggestions above and nothing worked. Then, I downgraded AngularJS from version 1.3.9-build.3746 to version 1.2.8. That is what I get for using beta versions.

    0 讨论(0)
提交回复
热议问题