|
| 1 | +import {Routes} from "@angular/router"; |
| 2 | +import {AuthenticationGuard} from "../guard/authentication.guard"; |
| 3 | +import {AccountContainerComponent} from "../component/account-container/account-container.component"; |
| 4 | +import {AccountComponent} from "../component/account/account.component"; |
| 5 | +import {SecurityComponent} from "../component/security/security.component"; |
| 6 | +import {SubscriptionComponent} from "../component/subscription/subscription.component"; |
| 7 | +import {LoginComponent} from "../component/login/login.component"; |
| 8 | +import {ProviderComponent} from "../component/login/provider/provider.component"; |
| 9 | +import {LogoutComponent} from "../component/logout/logout.component"; |
| 10 | +import {RegisterComponent} from "../component/register/register.component"; |
| 11 | +import {ActivateComponent} from "../component/register/activate/activate.component"; |
| 12 | +import {ResetComponent} from "../component/password/reset/reset.component"; |
| 13 | +import {ConfirmComponent} from "../component/password/confirm/confirm.component"; |
| 14 | +import {ListComponent as AppListComponent} from '../component/app/list/list.component'; |
| 15 | +import {ListComponent as EventListComponent} from '../component/event/list/list.component'; |
| 16 | + |
| 17 | +export class RouteBuilder { |
| 18 | + |
| 19 | + public static getRoutes(): Routes { |
| 20 | + return [ |
| 21 | + {path: 'account', component: AccountContainerComponent, canActivate: [AuthenticationGuard], children: [ |
| 22 | + {path: '', component: AccountComponent, canActivate: [AuthenticationGuard]}, |
| 23 | + {path: 'security', component: SecurityComponent, canActivate: [AuthenticationGuard]}, |
| 24 | + {path: 'app', component: AppListComponent, canActivate: [AuthenticationGuard]}, |
| 25 | + {path: 'app/:id', component: AppListComponent, canActivate: [AuthenticationGuard]}, |
| 26 | + {path: 'event', component: EventListComponent, canActivate: [AuthenticationGuard]}, |
| 27 | + {path: 'event/:id', component: EventListComponent, canActivate: [AuthenticationGuard]}, |
| 28 | + {path: 'subscription', component: SubscriptionComponent, canActivate: [AuthenticationGuard]}, |
| 29 | + ]}, |
| 30 | + {path: 'login', component: LoginComponent}, |
| 31 | + {path: 'login/:provider', component: ProviderComponent}, |
| 32 | + {path: 'logout', component: LogoutComponent}, |
| 33 | + {path: 'register', component: RegisterComponent}, |
| 34 | + {path: 'register/activate/:token', component: ActivateComponent}, |
| 35 | + {path: 'password/reset', component: ResetComponent}, |
| 36 | + {path: 'password/confirm/:token', component: ConfirmComponent} |
| 37 | + ]; |
| 38 | + } |
| 39 | + |
| 40 | +} |
0 commit comments