Angular 4: Router Outlet Management

I have two main component

  1. Login
  2. Dashboard

In the "Dashboard component" have some child components. Do I need to keep two <router-outlet></router-outlet>?

How I manage with Router. Please help

1 answer

  • answered 2018-11-08 08:19 ranjeet8082

    Second </router-outlet> will be in dashboard.component.html

    In route for dashboard give children property for child routes.

        path : 'dashboard',
        component : DashboardComponent,
        children: [
            path: 'childPath',
            component: ChildComponent