https://angular.io/tutorial/toh-pt5
router-outlet
https://www.techiediaries.com/angular-router-multiple-outlets/
Using Parameter in Routes :
https://www.techiediaries.com/angular-router/
https://www.techiediaries.com/angular-router-routerlink-navigate-navigatebyurl/
Exemple de paramètre dynamique : il faut importer ActivatedRoute et ParamMap (est un observable)
et initialiser ActivatedRoute dans le constucteur :
constructor(private route:ActivatedRoute ){}
ngOnInit() { this.route.snapshot.paramMap.get('name') }
const routes : Routes = [
{path: 'home', component: HomeComponent },
{path: 'login', component: LoginComponent},
{path: 'film/:name', component: FilmDetailCompoenent}
]
router-outlet
https://www.techiediaries.com/angular-router-multiple-outlets/
Using Parameter in Routes :
https://www.techiediaries.com/angular-router/
https://www.techiediaries.com/angular-router-routerlink-navigate-navigatebyurl/
Exemple de paramètre dynamique : il faut importer ActivatedRoute et ParamMap (est un observable)
et initialiser ActivatedRoute dans le constucteur :
constructor(private route:ActivatedRoute ){}
ngOnInit() { this.route.snapshot.paramMap.get('name') }
const routes : Routes = [
{path: 'home', component: HomeComponent },
{path: 'login', component: LoginComponent},
{path: 'film/:name', component: FilmDetailCompoenent}
]
Aucun commentaire:
Enregistrer un commentaire
to criticize, to improve