Let's suppose we have an application with a router configured as follows:
export const routes: Routes = [
{
path: 'supply', component: SupplyListComponent
},
{
path: 'supply/:id', component: SupplyComponent
}
];
Each supply can have one or more identifiers inside. Within the Supplycomponent, we have a paginator that shows each supply ID, one by one, on a card, changing the URL each time the user clicks on the next button. Example:
{
"supply1": [id_1],
"supply2": [id_2, id_3, id_4]
}
If we push Supply1, we go to '/supply/id_1'. If we push Supply2, we to '/supply/id_2', and we can change between ids with the paginator.
We want to access to this SupplyComponent in two ways: from the location '/supply' and from another aplication.
What's the problem? If we want to go to '/supply/id_3' from another application, we need to use ActivatedRoute, take that id and retrieve the information from API. But we only show the id_3 information, not all the information of Supply2.
Is there any way to 'detect' if the user comes from '/supply' or from another application? I've been looking for similar questions, but none fits my need.
Thanks in advance