【发布时间】:2017-08-11 14:29:07
【问题描述】:
这是我的当前设置:
- app (Folder)
- app-routing.module.ts (File)
- client (Folder)
- client-routing.module.ts (File)
- service (Folder)
- service-routing.module.ts (File)
- service1.componenent.ts (File)
- service2.componenent.ts (File)
所以,现在如果我在 service1.componenet 中使用 router.navigateByUrl,我将不得不这样做:
this.router.navigateByUrl('/client/service2');
我将不得不继续嵌套路由模块,所以以后知道路由的 “父母” 可能是个问题,我想知道是否有更有效的解决方案 而不是复制整个路线,例如:
this.router.navigateByUrl( parentRoute + '/service2');
其中的 parentRoute 是嵌套路由的汇编。
【问题讨论】:
标签: angular routing angular2-routing