| 1234567891011121314151617181920 |
- import { Routes } from '@angular/router';
- import {Register} from './register/register';
- import {Login} from './login/login';
- import {authGuard} from './guards/auth.guard';
- import {Admin} from './admin/admin';
- import {Home} from './home/home';
- import {Subjects} from './subjects/subjects';
- import {GradeTeacher} from './grade-teacher/grade-teacher';
- import {GradeStudent} from './grade-student/grade-student';
- export const routes: Routes = [
- {path: 'home', component: Home},
- { path: 'auth/signin', component: Login },
- { path: 'auth/signup', component: Register, canActivate: [authGuard], data: { roles: ['ROLE_ADMIN'] },},
- { path: 'admin', component: Admin, canActivate: [authGuard], data: { roles: ['ROLE_ADMIN'] },},
- { path: 'subjects', component: Subjects, canActivate: [authGuard], data: { roles: ['ROLE_ADMIN', "ROLE_TEACHER"] },},
- { path: 'subjects/:id', component: GradeTeacher, canActivate: [authGuard], data: { roles: ['ROLE_ADMIN', "ROLE_TEACHER"] },},
- { path: 'grade-student', component: GradeStudent, canActivate: [authGuard], data: { roles: ['ROLE_ADMIN', "ROLE_STUDENT"] },},
- { path: '', redirectTo: 'home', pathMatch: 'full' }
- ];
|