-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
  • 281
  • 1
  • 5
  • 18
  • 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
  • 1,192
  • 2
  • 12
  • 30