router.navigate angular params code example
Example 1: angular router navigate
goPlaces() {
this.router.navigate(['/', 'page-name']);
}
Example 2: angular routing url params
const appRoutes: Routes = [
{ path: 'crisis-center/:param1', component: CrisisListComponent },
{ path: 'hero/:param2', component: HeroDetailComponent },
];
@NgModule({
imports: [
RouterModule.forRoot(
appRoutes,
{ enableTracing: true }
)
],
...
})
export class AppModule { }
Example 3: router params angular
this.router.navigate(['/users/edit/', user.id]);