PatrickJS / angular-hmr

:fire: Angular Hot Module Replacement for Hot Module Reloading
https://patrickjs.com
Apache License 2.0
505 stars 46 forks source link

Back and forward cause route resolvers to get called one for each reload since full refresh #72

Open hahn-kev opened 6 years ago

hahn-kev commented 6 years ago

I use route resolvers to load data when a route is navigated too, and when I click a link to take me to a route everything works just fine, the app can update a bunch and it's fine.

However, if I use the back/forward buttons in the browser to navigate then each route resolver will get called for however many times the app has been hot updated, instead of just once. I've tried to take a look at the stack traces and figure out what's different, but there's a lot of code to dig through and I'm not familiar enough with angular internals to figure out the exact issue.

It seems like route resolvers might be getting added each time a reload happens and that's causing them to stack up.