1

Using a route with children in it. The parent route is recipes.component and in it, I includes a recipe-list.component and the .

The recipe-list.component utilizes the PrimeNG p-table and when you click on a recipe, the recipe detail displays courtesy of the router-outlet outputting recipe-detail.component.

All is good! BUT.....when I deep link to a particular recipe by going to http://example.com/recipes/100, I have no way of highlighting recipe ID 100 in the recipe list (p-table).

I'm subscribing to the route.params subscription in the recipe-detail.component just fine and tried to create an @Output() EventEmitter on the recipe ID, hoping to percolate it upwards to the parent (recipes.component) and therefore access the ID in the recipes-list.component (p-table). But no dice......!

Any recommendations on how to do this?

Brian Tompsett - 汤莱恩
  • 5,753
  • 72
  • 57
  • 129
amazonotter
  • 61
  • 1
  • 5

1 Answers1

0

Not sure i fully understand the question but maybe you should use angular "Resolver"

Angular Resolver

to get the data in the component prior to displaying it

Maayan Hope
  • 1,482
  • 17
  • 32