Answers for "refresh current component angular"

4

How to Reload a Component in Angular

reloadComponent() {
  let currentUrl = this.router.url;
      this.router.routeReuseStrategy.shouldReuseRoute = () => false;
      this.router.onSameUrlNavigation = 'reload';
      this.router.navigate([currentUrl]);
  }
Posted by: Guest on September-25-2020
1

refresh current component angular

reloadCurrentRoute() {
    let currentUrl = this._router.url;
    this._router.navigateByUrl('/', {skipLocationChange: true}).then(() => {
        this._router.navigate([currentUrl]);
        console.log(currentUrl);
    });
  }
Posted by: Guest on December-04-2020
0

how to make a component reload in angular

DeleteEmployee(id:number)
  {
    this.employeeService.deleteEmployee(id)
    .subscribe( 
      (data) =>{
        console.log(data);
        this.ngOnInit();
      }),
      err => {
        console.log("Error");
      }   
  }
Posted by: Guest on October-16-2020

Code answers related to "refresh current component angular"

Code answers related to "Javascript"

Browse Popular Code Answers by Language