AngularJS UI-Router. Неизвестный провайдер
Я получаю эту ошибку, но не знаю, где и как ее найти и исправить.
Я пробовал множество вещей, перечисленных вокруг минификации, но ни одна из них не сработала.
Мой модуль определяется здесь:
'use strict';
// create the module
angular.module('mean.dashboard', ['ui.bootstrap', 'xeditable', 'ui.router']);
angular.module('mean.dashboard').run(function(editableOptions) {
editableOptions.theme = 'bs3'; // bootstrap3 theme. Can be also 'bs2', 'default'
});
Вот копия моих маршрутов:
'use strict';
angular.module('mean.dashboard')
.config(['$stateProvider',
function($stateProvider) {
$stateProvider.state('dashboard', {
url: '/dashboard',
templateUrl: 'dashboard/views/index.html',
controller: 'DashboardController'
});
}
]);
Контроллер это:
'use strict';
angular.module('mean.dashboard')
.controller('DashboardController', ['$scope', '$http', 'Global', 'Dashboard',
function($scope, $http, Global, Dashboard) {
// Constants and globals
$scope.global = Global;
$scope.package = {
name: 'dashboard'
};
...
Ошибка от Chrome ниже. Ты знаешь почему?
Спасибо!
Error: [$injector:unpr] Unknown provider: DashboardProvider <- Dashboard
http://errors.angularjs.org/1.2.23/$injector/unpr?p0=DashboardProvider%20%3C-%20Dashboard
at http://localhost:3000/bower_components/angular/angular.js:78:12
at http://localhost:3000/bower_components/angular/angular.js:3802:19
at Object.getService [as get] (http://localhost:3000/bower_components/angular/angular.js:3930:39)
at http://localhost:3000/bower_components/angular/angular.js:3807:45
at getService (http://localhost:3000/bower_components/angular/angular.js:3930:39)
at invoke (http://localhost:3000/bower_components/angular/angular.js:3957:13)
at Object.instantiate (http://localhost:3000/bower_components/angular/angular.js:3977:23)
at http://localhost:3000/bower_components/angular/angular.js:7274:28
at http://localhost:3000/bower_components/angular/angular.js:6663:34
at forEach (http://localhost:3000/bower_components/angular/angular.js:332:20) <section data-ui-view="" class="ng-scope"> angular.js:10061
(anonymous function) angular.js:10061
(anonymous function) angular.js:7357nodeLinkFn angular.js:6707
compositeLinkFn angular.js:6098publicLinkFn angular.js:5994
updateView angular-ui-router.js:2733
(anonymous function) angular-ui-router.js:2697
Scope.$broadcast angular.js:12952
$state.transition.resolved.then.$state.transition angular-ui-router.js:2114
wrappedCallback angular.js:11561
(anonymous function) angular.js:11647
Scope.$eval angular.js:12673
Scope.$digest angular.js:12485
Scope.$apply angular.js:12777
done angular.js:8371
completeRequest angular.js:8585
xhr.onreadystatechange angular.js:8524
1 ответ
Решение
Удалить Dashboard из зависимости. Angular не находит приборную панель.
.controller('DashboardController', ['$scope', '$http', 'Global',
function($scope, $http, Global) {