未捕获错误:[$ injector:nomod]模块'myApp'不可用!您拼错了模块名称或忘记加载模块名称。如果注册模块确保您指定依赖关系作为第二个参数。 http://errors.angularjs.org/1.2.16/ $喷油器/ NOMOD?P0 = MyApp来我在运行Angular时遇到以下错误
以下是我的代码片断
Uncaught Error: [$injector:nomod] Module 'myApp' is not available! You either misspelled the module name or forgot to load it. If registering a module ensure that you specify the dependencies as the second argument.
http://errors.angularjs.org/1.2.16/ $喷油器/ NOMOD?P0 = MyApp来
以下是我的代码片断
(function() {
angular.module('myApp').controller('MainCtrl', function($scope) {
$scope.data = {
Colors: ["Monday", "Tuesday", "Wednesday", "Thursday", "Friday"]
}
});
angular.module('myApp').controller('OverviewCtrl', function($scope) {
$scope.list1 = {
title: 'AngularJS - Drag Me'
};
$scope.list2 = {};
});
}());
你需要使用它之前先创建模块(模块的第二个参数)只有一次。即'angular.module('myApp',[])' – PSL
谢谢你的作品 – django