import { NgModule } from '@angular/core' ; import { Routes , RouterModule } from '@angular/router' ; import { TodoComponent } from './todo.component' ; import { AuthGuardService } from '../core/auth-guard.service' ; const routes = [ { path : 'todo/:filter' , canActivate : [ AuthGuardService ] , component : TodoComponent } ] ; @ NgModule ( { imports : [ RouterModule . forChild ( routes ) ] , exports : [ RouterModule ] } ) export class TodoRoutingModule { }