“Jak poruszać się bez realodowania Angular” Kod odpowiedzi

Jak poruszać się bez realodowania Angular

import { Location } from '@angular/common';

constructor(private location: Location) { }

this.location.replaceState('/profile');
blackfire

Jak dodawać zmiany za każdym razem, gdy przechodzisz na stronę w Angular

// Place import at the top
import { Router,NavigationStart} from '@angular/router';

//Place the code below inside your class
constructor(private router: Router){}

ngOnInit(){
   this.router.events.subscribe(event =>{
      if (event instanceof NavigationStart){
   		
      }
   })
}
Lively Lark

Odpowiedzi podobne do “Jak poruszać się bez realodowania Angular”

Pytania podobne do “Jak poruszać się bez realodowania Angular”

Przeglądaj popularne odpowiedzi na kod według języka

Przeglądaj inne języki kodu