“So laden Sie eine Komponente in Angular neu” Code-Antworten

So aktualisieren Sie die Seite Winkel

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

Stromkomponente Angular Aktualisieren

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

So laden Sie eine Komponente in Angular neu

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

Winkel -Reload -Komponente

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

RelaD Sub Component Angular neu laden

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

wie man eine Komponente in Winkel neu lädt

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

Ähnliche Antworten wie “So laden Sie eine Komponente in Angular neu”

Fragen ähnlich wie “So laden Sie eine Komponente in Angular neu”

Weitere verwandte Antworten zu “So laden Sie eine Komponente in Angular neu” auf TypeScript

Durchsuchen Sie beliebte Code-Antworten nach Sprache

Durchsuchen Sie andere Codesprachen