1this.router.navigate(['path/to'])
2 .then(() => {
3 window.location.reload();
4 });
1reloadComponent() {
2 let currentUrl = this.router.url;
3 this.router.routeReuseStrategy.shouldReuseRoute = () => false;
4 this.router.onSameUrlNavigation = 'reload';
5 this.router.navigate([currentUrl]);
6 }
1reloadCurrentRoute() {
2 let currentUrl = this.router.url;
3 this.router.navigateByUrl('/', {skipLocationChange: true}).then(() => {
4 this.router.navigate([currentUrl]);
5 });
6}
7
1 reloadCurrentRoute() {
2 let currentUrl = this._router.url;
3 this._router.navigateByUrl('/', {skipLocationChange: true}).then(() => {
4 this._router.navigate([currentUrl]);
5 console.log(currentUrl);
6 });
7 }