Angular how to get the non activated children routes

旧城冷巷雨未停 提交于 2021-02-19 03:38:06

问题


In Angular you can always inject ActivatedRoute in your component to get a reference to the current activated route.

It has a property children which:

Contains all the child routes activated under the current route.

I was wondering how can I get all the children routes (so also the non activated ones).


回答1:


You could use route.routeConfig.children to get the children defined in the router.



来源:https://stackoverflow.com/questions/46069944/angular-how-to-get-the-non-activated-children-routes

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!