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

拥有回忆 提交于 2019-11-30 19:44:18

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.

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.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!