import { DashboardComponent } from './dashboard/dashboard.component' ; import { NgModule } from '@angular/core' ; import { Routes , RouterModule } from '@angular/router' ; import { MainComponent } from './main/main.component' ; import { SurveyComponent } from './survey/survey.component' ; import { BlogComponent } from './blog/blog.component' ; import { InboxComponent } from './inbox/inbox.component' ; const routes = [ { path : '' , component : DashboardComponent , children : [ { path : '' , redirectTo : 'inbox' , pathMatch : 'full' } , { path : 'main' , component : MainComponent } , { path : 'survey' , component : SurveyComponent } , { path : 'blog' , component : BlogComponent } , { path : 'inbox' , component : InboxComponent } ] } ] ; @ NgModule ( { imports : [ RouterModule . forChild ( routes ) ] , exports : [ RouterModule ] } ) export class DashboardRoutingModule { }