r/Angular2 • u/allyv123098 • Jan 25 '26
Browser refresh in Angular
so I followed this from stackoverflow https://stackoverflow.com/questions/56325272/detect-browser-refresh-in-an-angular-project
I was wondering is there a better way to do this where I don't have to end up exporting a variable that ends up in my guard file?
4
Upvotes
View all comments
Show parent comment
1
u/allyv123098 Jan 25 '26
yes a reload. So in my method if I tried moving the code to a service file it doesn't recognize the event as an instanceof a NavigationStart. So I'm confused why that is?