AngularJS新路由器-多视口路由参数不工作
我的SPA使用新的角度路由器。一切正常,但现在我想向其中一个组件传递一个参数。每个路由中都有多个视口,在这种情况下,我无法获取传递给路由器的参数 路由AngularJS新路由器-多视口路由参数不工作,angularjs,angularjs-new-router,Angularjs,Angularjs New Router,我的SPA使用新的角度路由器。一切正常,但现在我想向其中一个组件传递一个参数。每个路由中都有多个视口,在这种情况下,我无法获取传递给路由器的参数 路由 AppController.$routeConfig = [ { path: '/', redirectTo: '/home' }, { path: '/home', components: { 'main': 'home',
AppController.$routeConfig = [
{
path: '/',
redirectTo: '/home'
},
{
path: '/home',
components: {
'main': 'home',
'footer': 'footer'
},
as: 'home'
},
{
path: '/request',
components: {
'main': 'request',
'footer': 'footer'
},
as: 'request'
},
{
path: '/request/:id',
components: {
'main': 'request',
'footer': 'footer'
},
as: 'requestid'
},
{
path: '/allItems',
components: {
'main': 'allItems',
'footer': 'footer'
}, as: 'allItems'
}
];
路线的召唤
<a class="btn btn-warning" aria-haspopup="true" aria-expanded="false" ng-link="requestid({id: 1})">
我错过了什么?提前谢谢
https://<sitename>/index.aspx#/request/1
angular.module('app.request')
.controller('requestController', ['$routeParams', '$scope', function ($routeParams, $scope) {
$scope.id = $routeParams.id;
}]);