Angular 6 and PrimeNG p-table (Tables)

871 views Asked by At

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?

1

There are 1 answers

0
Maayan Hope On

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