study-lib-frontend/src/app/app-routing.module.ts
2020-12-23 23:37:16 +01:00

19 lines
758 B
TypeScript

import { GroupModule } from './group/group.module';
import { AuthGuard } from './auth/auth.guard';
import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router';
const routes: Routes = [
{ path: '', redirectTo: 'user', pathMatch: 'full' },
{ path: 'group', loadChildren: () => import('./group/group.module').then(m => m.GroupModule), canActivate: [AuthGuard] },
{ path: 'subject', loadChildren: () => import('./subject/subject.module').then(m => m.SubjectModule), canActivate: [AuthGuard] },
{ path: 'user', loadChildren: () => import('./user/user.module').then(m => m.UserModule) }
];
@NgModule({
imports: [RouterModule.forRoot(routes)],
exports: [RouterModule]
})
export class AppRoutingModule { }