title: Routing With ID in Angular 4
body: <p>I need help in my routing in Angular 4. I want to display the URL like this. Localhost:4200/user/1 if i clicked the view details of the first user. I'm a bit confused on how to to this. I've tried my best in my code below but it still doesn't work.</p>
  <blockquote>
  <p>app-routing.module.ts</p>
  </blockquote>
  <pre class="lang-js prettyprint-override"><code>    const appRoutes: Routes = [
          { path: '', redirectTo: '/dashboard', pathMatch: 'full' },
          { path: 'dashboard', component: DashboardComponent },
          { path: 'user', component: UserComponent, children: [
              
              { path: 'create-new-user', component: CreateNewUserComponent },
              { path: 'user-list', component: UserListComponent },
              { path: 'user-detail/:id', component: UserDetailComponent },
  
      ]},
      ];
      
      
      @NgModule({
          imports: [RouterModule.forRoot(appRoutes)],
          exports: [RouterModule]
      })
      export class AppRoutingModule {
      
      }
  </code></pre>