import { NgModule } from '@angular/core' ; import { Routes , RouterModule } from '@angular/router' ; import { DashboardComponent } from './dashboard/dashboard/dashboard.component' ; import { AppComponent } from './app.component' ; const routes = [ { path : '' , component : AppComponent , children : [ { path : '' , redirectTo : 'dashboard' , pathMatch : 'full' } , { path : 'dashboard' , loadChildren : './dashboard/dashboard.module#DashboardModule' } ] } ] ; @ NgModule ( { imports : [ RouterModule . forRoot ( routes ) ] , exports : [ RouterModule ] } ) export class AppRoutingModule { }