Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/csharp-4.0/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
AngularJS新路由器-多视口路由参数不工作_Angularjs_Angularjs New Router - Fatal编程技术网

AngularJS新路由器-多视口路由参数不工作

AngularJS新路由器-多视口路由参数不工作,angularjs,angularjs-new-router,Angularjs,Angularjs New Router,我的SPA使用新的角度路由器。一切正常,但现在我想向其中一个组件传递一个参数。每个路由中都有多个视口,在这种情况下,我无法获取传递给路由器的参数 路由 AppController.$routeConfig = [ { path: '/', redirectTo: '/home' }, { path: '/home', components: { 'main': 'home',

我的SPA使用新的角度路由器。一切正常,但现在我想向其中一个组件传递一个参数。每个路由中都有多个视口,在这种情况下,我无法获取传递给路由器的参数

路由

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;
}]);