Skip to content

Instantly share code, notes, and snippets.

@lydemann
Last active December 29, 2020 18:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lydemann/85e452ed4c29f77f1f9aafde6311990f to your computer and use it in GitHub Desktop.
Save lydemann/85e452ed4c29f77f1f9aafde6311990f to your computer and use it in GitHub Desktop.
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