refresh the page on ngoninit code example Example: how to refresh page angular refresh(): void { window.location.reload(); }