Passing Parameters to Routes in Angular 4

Use Id for this in routing code.

–TS File (app.routing.module.ts)

const appRoutes: Routes = [
  { path: '', component: HomeComponent},
  { path: 'users', component: UserComponent},
  { path: 'users/:id', component: UserComponent},
  { path: 'servers', component: ServersComponent},
    ] },
]

Leave a Reply

Your email address will not be published. Required fields are marked *