Angular – Reload page (and its components) even if on same url

Tested in Angular 19.

Add router to component constructor:

import { Router } from '@angular/router';
...

  public constructor(
    private _router: Router
  ) {}

Navigate and reload page, even if currently on same url

this._router.navigateByUrl('/', { skipLocationChange: true }).then(() => {
  this._router.navigate(['my-page']);
});

Above code navigates to root path without changing url in browser, then navigates to current url /my-page. E.g. “reloads” current page (which has path /mypage).

Leave a Reply

Your email address will not be published. Required fields are marked *