0
Ошибка:Не удалось создать экземпляр модуля из-за не удалось создать экземпляр модуля зависимостях
Uncaught Error: [$injector:modulerr] Failed to instantiate module myApp due to:
Error: [$injector:modulerr] Failed to instantiate module myApp.customer due to:
Error: [$injector:nomod] Module 'myApp.customer' 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.
Мой app.js
содержит следующий код:
var myApp = angular.module('myApp', ['ui.router',
'myApp.customer'
]);
myApp.config(function myAppConfig ($stateProvider, $urlRouterProvider) {
$urlRouterProvider.otherwise('/account');
});
myApp.run(function run() {
});
myApp.controller('AppCtrl', function AppCtrl ($scope, $location) {
$scope.$on('$stateChangeSuccess', function(event, toState, toParams, fromState, fromParams){
if (angular.isDefined(toState.data.pageTitle)) {
$scope.pageTitle = toState.data.pageTitle ;
}
});
});
Модуль myApp.customer
выглядит следующим образом:
angular.module('myApp.customer', ['ui.router','ngResource'])
.config(function($stateProvider) {
$stateProvider.state('customer', {
url:'/customer',
views: {
'main': {
templateUrl:'customer/customer.tpl.html',
controller: 'CustomerCtrl'
}
},
resolve: {
},
data : { pageTitle : "Customers" }
});
})
.controller("CustomerCtrl", function($scope) {
});
так синтаксическая ошибка в конце файла легитимной? '.controller' – charlietfl
, он дает мне такую же ошибку даже после удаления дополнительной точки с запятой – MindBrain