window.reload in angular 9 code example
Example 1: angular reload component
reloadCurrentRoute() {
let currentUrl = this.router.url;
this.router.navigateByUrl('/', {skipLocationChange: true}).then(() => {
this.router.navigate([currentUrl]);
});
}
Example 2: refresh page angular
refresh(): void {
window.location.reload();
}