我正在构建一个 angularjs 应用程序,我的 app.js 看起来像这样。但是,它会引发Unknown provider: $routeParams
错误。知道为什么吗?
var angularSite = angular.module('angularSite', [
'ui.router',
'ngRoute',
'siteController',
'siteDirectives'
])
.config(['$routeProvider', '$routeParams',
function($routeProvider,$routeParams) {
$routeProvider.
when('/Projects', {
templateUrl: 'partials/projects.html',
controller: 'ProjectController'
}).
when('/Projects/:projectId', {
template: 'partials/pages/'+$routeParams.projectId+'.html',
controller: 'ProjectDetailController'
}).
otherwise({
redirectTo: '/About'
});
}]);