import { NgModule } from '@angular/core' ; import { RouterModule , Routes } from '@angular/router' ; import { DetailComponent } from './detail/detail.component' ; import { MagnitudeComponent } from './magnitude/magnitude.component' ; import { OriginComponent } from './origin/origin.component' ; import { PhaseComponent } from './phase/phase.component' ; const originRoutes = [ { children : [ { component : DetailComponent , path : 'detail' } , { component : PhaseComponent , path : 'phase' } , { component : MagnitudeComponent , path : 'magnitude' } , { path : '' , pathMatch : 'full' , redirectTo : 'detail' } ] , component : OriginComponent , path : '' } ] ; @ NgModule ( { exports : [ RouterModule ] , imports : [ RouterModule . forChild ( originRoutes ) ] } ) export class OriginRoutingModule { }