我有以下app.js,无法使用模块调用应用程序。附上文件夹结构和代码的截图:
core.module.js:
(function() {
'use strict';
angular
.module('app.core');
})();

(function () {
'use strict';
angular
.module('app', [
'ngRoute',
'ngCookies',
'ngAnimate',
'ngResource',
'ngCookies',
'ngTouch',
'app.core',
'app.events'
])
.config(config);
config.$inject = ['$routeProvider', '$locationProvider', '$httpProvider'];
function config($routeProvider, $locationProvider, $httpProvider) {
$routeProvider
.when('/', {..}..

Uncaught Error: [$injector:nomod] Module 'app.core' 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.

答案 0 :(得分:5)
您需要angular.module()
上的第二个参数;
请参阅Document
//创建一个新模块
var myModule = angular.module(' myModule',[]);
angular
.module('app.core',[]);
答案 1 :(得分:0)
So to create angular module, you will have to write angular.module('app.core', []).