import { NgModule } from '@angular/core' ; import { Routes , RouterModule } from '@angular/router' ; import { SpeakerListComponent } from './speaker-list/speaker-list.component' ; import { SpeakerComponent } from './speaker/speaker.component' ; import { SpeakersComponent } from './speakers.component' ; import { CanDeactivateGuard } from '../core' ; const routes = [ { path : '' , component : SpeakersComponent , children : [ { path : '' , component : SpeakerListComponent } , { path : ':id' , component : SpeakerComponent , canDeactivate : [ CanDeactivateGuard ] } ] } ] ; @ NgModule ( { imports : [ RouterModule . forChild ( routes ) ] , exports : [ RouterModule ] } ) export class SpeakersRoutingModule { } export const routedComponents = [ SpeakersComponent , SpeakerListComponent , SpeakerComponent ] ;