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