reloadComponent() { let currentUrl = this.router.url; this.router.routeReuseStrategy.shouldReuseRoute = () => false; this.router.onSameUrlNavigation = 'reload'; this.router.navigate([currentUrl]); }
reloadCurrentRoute() { let currentUrl = this.router.url; this.router.navigateByUrl('/', {skipLocationChange: true}).then(() => { this.router.navigate([currentUrl]); }); }
DeleteEmployee(id:number) { this.employeeService.deleteEmployee(id) .subscribe( (data) =>{ console.log(data); this.ngOnInit(); }), err => { console.log("Error"); } }