Skip to content

Instantly share code, notes, and snippets.

@lydemann

lydemann/app.routing.ts

Last active Dec 29, 2020
Embed
What would you like to do?
app.routing.ts
const routes: Routes = [
{
path: ':schoolId',
resolve: [SchoolIdResolver],
children: [
{
path: '',
pathMatch: 'full',
redirectTo: 'courses'
},
{
path: 'courses',
resolve: [RedirectIfLoggedOutResolver]
children: [
{
path: '',
loadChildren: () =>
import('./courses/courses.module').then(m => m.CoursesModule)
},
{
path: ':courseId',
loadChildren: () =>
import('./course/course.module').then(m => m.CourseModule)
}
]
},
{
path: 'help',
resolve: [RedirectIfLoggedOutResolver],
loadChildren: () => import('./help/help.module').then(m => m.HelpModule)
},
{
path: 'profile',
resolve: [RedirectIfLoggedOutResolver],
loadChildren: () =>
import('./profile/profile.module').then(m => m.ProfileModule)
},
{
path: 'help',
loadChildren: () => import('./help/help.module').then(m => m.HelpModule)
},
{
path: 'login',
loadChildren: () =>
import('./login/login.module').then(m => m.LoginModule)
}
]
}
];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment