// app-routing.module
const routes:Routes = [
{ path: 'welcome', component: LandingPageComponent, pathMatch: 'full' },
{ path: 'login/:id', canActivate: [AuthGuard], children: [] },
{ path: '', canActivateChild: [AuthGuard], children: [
{ path: '', redirectTo: '/courses', pathMatch: 'full' },
{ path: 'courses', loadChildren: './courses/course.module#CourseModule', canLoad: [AuthGuard] }
]},
{ path: '**', component: PageNotFoundComponent, pathMatch: 'full' }
]
// course-routing.module
const routes:Routes = [
{
path: '',
component: CourseListComponent,
canActivate: [AuthGuard],
canActivateChild: [AuthGuard],
children:[
{ path: '', redirectTo: '/courses', pathMatch: 'full' },
{ path: ':courseId', component: CourseDetailComponent, pathMatch: 'full' },
{ path: ':courseId/unit/:unitId', component: CoursePlayComponent,
children: [
{ path: '', component: CourseListComponent },
{ path: 'lesson/:lessonId', component: CourseLessonComponent, data:{ type: 'lesson'} },
{ path: 'quiz/:quizId', component: CourseQuizComponent, data: {type: 'quiz'} }
]}
]}
]