Retrieving the active component and path

前端 未结 5 757
既然无缘
既然无缘 2021-01-12 22:51

With Angular2, how would I retrieve the current active component and path?

For example I might have the following routes:

{ path: \'\', component:          


        
5条回答
  •  长情又很酷
    2021-01-12 23:39

    you can enable trace in your router config for root {enableTracing: true} to get more idea how routes are resolved and activated

提交回复
热议问题