angular router navigate then reload angular router navigate then reload angular angular

angular router navigate then reload


Simple

this.router.navigate(['path/to'])  .then(() => {    window.location.reload();  });


What you could do is shift the reload logic to the actual component which needs to be reloaded. You can subscribe to the NavigationEnd event and then check the route you're coming from e.g.

this.router.events  .pipe(    filter(value => value instanceof NavigationEnd),  )  .subscribe(event => {  if (event.url === 'http://mypreviousUrl.com') {    this.window.location.reload();  }});