Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/typescript/9.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

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/angular/31.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
Typescript “不允许使用子路由”/&引用;。使用“…”&引用;在父对象上';s路径_Typescript_Angular_Angular2 Routing_Angular2 Router - Fatal编程技术网

Typescript “不允许使用子路由”/&引用;。使用“…”&引用;在父对象上';s路径

Typescript “不允许使用子路由”/&引用;。使用“…”&引用;在父对象上';s路径,typescript,angular,angular2-routing,angular2-router,Typescript,Angular,Angular2 Routing,Angular2 Router,我有一个父页面kms.html,它与路由器插座一起加载,路由器插座加载登录页面,我的登录页面基于我实现的路由。。。现在在路由到我的登录页后,它又有了路由器出口,如果我在登录组件中写入 @RouteConfig([ { path: '/kms/test', name:'Test', component: testComponent } ]) 它抛出了一个错误,因为/kms不允许子路由。在父路径上使用… 如果我删除@RouteConfig部分,它的工作正常,但我无法执行子

我有一个父页面kms.html,它与路由器插座一起加载,路由器插座加载登录页面,我的登录页面基于我实现的路由。。。现在在路由到我的登录页后,它又有了路由器出口,如果我在登录组件中写入

@RouteConfig([

        { path: '/kms/test', name:'Test', component: testComponent }
    ])
它抛出了一个错误,因为
/kms
不允许子路由。在父路径上使用

如果我删除
@RouteConfig
部分,它的工作正常,但我无法执行子路由


有什么线索吗?

定义父级的路由配置,如下所示:

{ path: '/kms/...', component: XXXComponent, as: 'Kms?' }
在您孩子的路线配置中,只需这样写:

{ path: '/test', name:'Test', component: testComponent }

定义父级的路由配置,如下所示:

{ path: '/kms/...', component: XXXComponent, as: 'Kms?' }
在您孩子的路线配置中,只需这样写:

{ path: '/test', name:'Test', component: testComponent }