1reloadComponent() {
2 let currentUrl = this.router.url;
3 this.router.routeReuseStrategy.shouldReuseRoute = () => false;
4 this.router.onSameUrlNavigation = 'reload';
5 this.router.navigate([currentUrl]);
6 }
1 reloadCurrentRoute() {
2 let currentUrl = this._router.url;
3 this._router.navigateByUrl('/', {skipLocationChange: true}).then(() => {
4 this._router.navigate([currentUrl]);
5 console.log(currentUrl);
6 });
7 }
1DeleteEmployee(id:number)
2 {
3 this.employeeService.deleteEmployee(id)
4 .subscribe(
5 (data) =>{
6 console.log(data);
7 this.ngOnInit();
8 }),
9 err => {
10 console.log("Error");
11 }
12 }
13