我想访问组件的路由URL,即
不
当前url并将其存储在服务中。所以基本上如果我的组件是
parentComponent
并且有
childComponent
然后子组件的URL是
/parentComponent/childComponent
如果我导航到上面的URL并调用
this.router.url
在里面
父组件
的
ngOnInit
然后它会正确地返回
/parentComponent/childComponent
. 我怎么才能
/parentComponent
,即从父组件内的路由器到组件本身的路由?