angular force reload page code example
Example 1: angular 8 ts refresh page
refresh(): void {
window.location.reload();
}
Example 2: reload page in typescript
window.location.reload();
Example 3: angular typescript refresh page
this.router.routeReuseStrategy.shouldReuseRoute = function(){
return false;
};
this.router.events.subscribe((evt) => {
if (evt instanceof NavigationEnd) {
this.router.navigated = false;
window.scrollTo(0, 0);
}
});
Example 4: angular 8 ts refresh page
<button (click)="refresh()">Refresh</button>