我有这个状态confg:
function routeConfig($stateProvider, $urlRouterProvider) {
$stateProvider
.state('projects', {
url: '/projects',
template : '<ui-view autoscroll="true" autoscroll-body-top></ui-view>',
abstract: true,
title: 'Les projets',
controller : 'ProjectController',
}) .state('projects.add', {
url: '/add',
templateUrl: 'http://localhost:8080/gestionprojet/projects',
title: 'Ajouter un projet',
})
.state('projects.detail', {
url: '/detail',
params : { projectId : null},
templateUrl: 'http://localhost:8080/gestionprojet/detailProject',
resolve : {
project: function (projectFactory, $stateParams) {
return projectFactory.getProject($stateParams.projectId);
},
projectTasks : function (projectFactory, $stateParams) {
return projectFactory.getProjectTasks($stateParams.projectId);
}
},
title: 'Detail du projet',
});
}
并在我的控制器中:
angular.module('BlurAdmin.pages.projects')
.controller('ProjectController', ProjectController);
function ProjectController($state, $stateParams, $log, $scope, projectFactory, taskFactory, project, projectTasks) { ... }
如果我转到project.add
:
未知提供者:projectProvider&lt; - project&lt; - ProjectController
如何解决这个问题?谢谢。