loading...

re: Mastering Angular 8: five things that are good to know to save your time. VIEW POST

FULL DISCUSSION
 

Nice article. Regarding the reloading of the component when navigating to the same URL you could also use the router config

RouterModule.forRoot(routes, {
    onSameUrlNavigation: 'reload'
})

Obviously just if you want to have that behavior for the entire app

 

This will not mount component once again!!!
It only ensures that router events will be emitted.
If you navigate to the same route (like from cars/2 to cars/3) it's the RouteReuseStrategy which determines whether a component should be mounted once again.
See here for an example where it's overridden in order to make animations work as expected medium.com/frontend-coach/angular-...

 

Thanks, Juri!

Code of Conduct Report abuse