title: PrimeNG: How to programmatically expand a lazily loaded tree
body: <p>I have a <a href="https://www.primefaces.org/primeng/#/tree" rel="nofollow noreferrer">Angular2 Primefaces Tree</a> 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.</p>
  
  <p>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.</p>
  
  <p>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?</p>