title: How do I define nested child routes in Angular 2?
body: <p>I have the app structure as follows</p>
  
  <pre><code>.
  ├── photos
  ├── posts
  ├── users
  │   ├── detail
  │   │   ├── address
  │   │   ├── family
  │   │   ├── information
  │   │   └── phones
  │   ├── friends
  │   └── profile
  └── videos
  </code></pre>
  
  <p>To create the nested routes, I prefer routes of same level at their own level. </p>
  
  <p>For example:</p>
  
  <p>first level routes go in the root routes. second level routes go to the users routes and third level goes to the detail route.</p>
  
  <p>so the root routes looks like this,</p>
  
  <pre><code>const appRoutes: Routes = [
    {
      path: '',
      component: HomeComponent
    },
    {
      path: 'photos',
      component: PhotosComponent
    },
    {
      path: 'posts',
      component: PostsComponent
    },
    {
      path: 'users',
      component: UserListComponent
    },
    {
      path: 'user/:username',
      component: UserComponent
    },
    {
      path: 'videos',
      component: VideosComponent
    }
  ]
  export const AppRoutes = RouterModule.forRoot(appRoutes);
  
  
  // and the for the user routes,
  
  
  const userRoutes: Routes = [
    {
      path: 'detail',
      component: DetailComponent
    },
    {
      path: 'friends',
      component: FriendsComponent
    },
    {
      path: 'profile',
      component: ProfileComponent
    }
  ]
  export const UserRoutes = RouterModule.forChild(userRoutes);
  
  // and for the detail routes,
  
  
  const detailRoutes: Routes = [
    {
      path: 'address',
      component: AddressComponent
    },
    {
      path: 'family',
      component: FamilyComponent
    },
    {
      path: 'info',
      component: InformationComponent
    },
    {
      path: 'phones',
      component: PhonesComponent
    }
  ]
  export const DetailRoutes = RouterModule.forChild(detailRoutes);
  </code></pre>
  
  <p>How do I mix up the given routes?
  I want the route to be <code>/users/:username/detail/info</code> but can't figure out how to couple them.</p>