on refresh function angular code example
Example 1: refresh current component angular
reloadCurrentRoute() {
let currentUrl = this._router.url;
this._router.navigateByUrl('/', {skipLocationChange: true}).then(() => {
this._router.navigate([currentUrl]);
console.log(currentUrl);
});
}
Example 2: angular refresh page without reloading
this.router.navigate(['path/to'])
.then(() => {
window.location.reload();
});