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

后端 未结 2 402
甜味超标
甜味超标 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.

提交回复
热议问题