I have a Angular2 Primefaces Tree that is lazily loaded and is used as the navigation component of my application. Clicking nodes in the tree navigates to a corresponding route. I want the reverse to be true: That whenever the application is navigated to a route, the tree will expand and select accordingly.
Since the tree is outside of the router-outlet, I have its component get route parameters from a service (because ActivatedRoute doesn't work outside of router-outlet yet...) and call a method that searches my TreeNode[] for the correct node, then expands it (by setting .expanded = true), then searches its children, then expands it, etc until the expanded state of the Tree should match my route.
Problem is that what I end up with is the top-level node's arrow points down instead of right, but none of its children are shown. I think this has to do with lazy loading, but I don't know how to resolve it. Am I missing something?