0

There is a method

    this.router.navigate([`${numer}`]).then(() => {});

this method is in the footer module. This method redirects to http://localhost:4200/7.

The page http://localhost:4200/7 is served by the body module.

My task is to determine how the client clicked on this link. For example: it was a direct link received by e-mail or it was the router.navigate method that worked.

Can you please tell me how to determine this?

I need to understand if the router.navigate method worked or not.

Maks
  • 11
  • 4

1 Answers1

0

You can use URL params. Provide it as <route>?param1=lorem&param2=ipsum. You can then check the values of the params in any component by checking these params.

See How to get URL parameters in JavaScript?

paddotk
  • 1,359
  • 17
  • 31