I would like to ask it is possible to open current page again using routerLink. I have this menu:
<ul>
<li><a routerLink="home">Home</a></li>
<li><a routerLink="users">Users</a></li>
</ul>
when current url is www.domain.com/users
i would like to click on "Users" in menu and refresh this page. It is possible?
I know that i use location.reload()
but it redirect full page.
I'm not sure if this would work in Angular 4, but in Angular 5 there is an option for reloading the active route:
RouterModule.forRoot(routes, {onSameUrlNavigation: 'reload'})
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With