如问题中所述,$location
此时控制器中无法访问服务debugger
。
$(document).ready(function() {
return angular.module('dashboard.controllers').controller(
'projectController',
['$route', '$routeParams', '$scope', '$location', '$rootScope',
'ProjectDataService', 'UserService',
function($route, $routeParams,$scope, $location, $rootScope,
ProjectDataService, UserService)
{
return ProjectDataService.loadProjectData().then(function(d) {
$scope.projectSearch = "";
$scope.projects = ProjectDataService.getProjectData();
debugger;
});
}
]);
});