“Como recarregar um componente no angular” Respostas de código

Como atualizar a página angular

refresh(): void {
    window.location.reload();
}
|_Genos_|

Atualizar o componente atual angular

  reloadCurrentRoute() {
    let currentUrl = this._router.url;
    this._router.navigateByUrl('/', {skipLocationChange: true}).then(() => {
        this._router.navigate([currentUrl]);
        console.log(currentUrl);
    });
  }
Foolish Fly

Como recarregar um componente no angular

reloadComponent() {
  let currentUrl = this.router.url;
      this.router.routeReuseStrategy.shouldReuseRoute = () => false;
      this.router.onSameUrlNavigation = 'reload';
      this.router.navigate([currentUrl]);
  }
Courageous Chamois

Componente de recarga angular

reloadCurrentRoute() {
    let currentUrl = this.router.url;
    this.router.navigateByUrl('/', {skipLocationChange: true}).then(() => {
        this.router.navigate([currentUrl]);
    });
}
Courageous Chamois

Recarregue o subtonete angular

this.router.navigateByUrl('/RefreshComponent', { skipLocationChange: true }).then(() => {
    this.router.navigate(['Your actualComponent']);
}); 
|_Genos_|

como fazer um componente recarregar em angular

DeleteEmployee(id:number)
  {
    this.employeeService.deleteEmployee(id)
    .subscribe( 
      (data) =>{
        console.log(data);
        this.ngOnInit();
      }),
      err => {
        console.log("Error");
      }   
  }
Famous Fly

Respostas semelhantes a “Como recarregar um componente no angular”

Perguntas semelhantes a “Como recarregar um componente no angular”

Mais respostas relacionadas para “Como recarregar um componente no angular” em TypeScript

Procure respostas de código populares por idioma

Procurar outros idiomas de código