-1

I'm trying to get the latest router (url) that the user has gone to and store it in local storage. Anyone know a way to do this? thank you

mahdi aghasi
  • 259
  • 1
  • 3
  • 17
  • 2
    Does this answer your question? [How to determine previous page URL in Angular?](https://stackoverflow.com/questions/41038970/how-to-determine-previous-page-url-in-angular) – Dortimer Dec 17 '19 at 21:33

1 Answers1

0

Probably you can make use of ActivatedRoute class.

you can inject in your component like below and use some of its in-built methods.

constructor(private route: ActivatedRoute) { }

More info in angular docs https://angular.io/api/router/ActivatedRoute

Pradeep
  • 966
  • 1
  • 8
  • 24