76 lines
2.0 KiB
TypeScript
76 lines
2.0 KiB
TypeScript
import {RouterModule, Routes} from "@angular/router";
|
|
import {LoginComponent} from "./login/index";
|
|
import {NotFoundComponent} from "./common/not-found/not-found.component";
|
|
import {LoginGuardAdmin, LoginGuardHL} from "./login/login.guard";
|
|
import {armyRoutes, armyRoutingComponents} from "./army/army.routing";
|
|
import {SignupComponent} from "./login/signup.component";
|
|
import {RouteConfig} from "./app.config";
|
|
|
|
export const appRoutes: Routes = [
|
|
{
|
|
path: RouteConfig.overviewPath,
|
|
children: armyRoutes
|
|
},
|
|
{
|
|
path: '', redirectTo: RouteConfig.overviewPath,
|
|
pathMatch: 'full'
|
|
},
|
|
{
|
|
path: RouteConfig.statsPath,
|
|
loadChildren: './statistic/stats.module#StatsModule'
|
|
},
|
|
{
|
|
path: RouteConfig.request,
|
|
loadChildren: './request/request.module#RequestModule'
|
|
},
|
|
{
|
|
path: RouteConfig.userPath,
|
|
loadChildren: './users/users.module#UsersModule',
|
|
canActivate: [LoginGuardHL]
|
|
},
|
|
{
|
|
path: RouteConfig.squadPath,
|
|
loadChildren: './squads/squads.module#SquadsModule',
|
|
canActivate: [LoginGuardHL]
|
|
},
|
|
{
|
|
path: RouteConfig.decorationPath,
|
|
loadChildren: './decorations/decoration.module#DecorationsModule',
|
|
canActivate: [LoginGuardHL]
|
|
},
|
|
{
|
|
path: RouteConfig.rankPath,
|
|
loadChildren: './ranks/ranks.module#RanksModule',
|
|
canActivate: [LoginGuardHL]
|
|
},
|
|
{
|
|
path: RouteConfig.adminPanelPath,
|
|
loadChildren: './admin/admin.module#AdminModule',
|
|
canActivate: [LoginGuardAdmin]
|
|
},
|
|
{
|
|
path: RouteConfig.loginPath,
|
|
component: LoginComponent
|
|
},
|
|
{
|
|
path: RouteConfig.signUpPath,
|
|
component: SignupComponent
|
|
},
|
|
|
|
/** Redirect Configuration **/
|
|
// {
|
|
// path: '404',
|
|
// component: NotFoundComponent
|
|
// },
|
|
// {
|
|
// path: '**',
|
|
// redirectTo: '/404'
|
|
// } // always configure this last - first matching route gets processed
|
|
];
|
|
|
|
export const appRouting = RouterModule.forRoot(appRoutes);
|
|
|
|
export const routingComponents = [...armyRoutingComponents, LoginComponent, SignupComponent, NotFoundComponent];
|
|
|
|
export const routingProviders = [LoginGuardHL, LoginGuardAdmin];
|