问题
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