Add ranks module
parent
b2dd827f98
commit
711e82e6cc
|
@ -9,7 +9,6 @@ import {SquadStore} from "./services/stores/squad.store";
|
||||||
import {DecorationStore} from "./services/stores/decoration.store";
|
import {DecorationStore} from "./services/stores/decoration.store";
|
||||||
import {DecorationService} from "./services/decoration-service/decoration.service";
|
import {DecorationService} from "./services/decoration-service/decoration.service";
|
||||||
import {SquadItemComponent} from "./squads/squad-list/squad-item.component";
|
import {SquadItemComponent} from "./squads/squad-list/squad-item.component";
|
||||||
import {RankItemComponent} from "./ranks/rank-list/rank-item.component";
|
|
||||||
import {RankStore} from "./services/stores/rank.store";
|
import {RankStore} from "./services/stores/rank.store";
|
||||||
import {RankService} from "./services/rank-service/rank.service";
|
import {RankService} from "./services/rank-service/rank.service";
|
||||||
import {AppConfig} from "./app.config";
|
import {AppConfig} from "./app.config";
|
||||||
|
@ -45,7 +44,6 @@ import {BrowserAnimationsModule} from "@angular/platform-browser/animations";
|
||||||
declarations: [
|
declarations: [
|
||||||
AppComponent,
|
AppComponent,
|
||||||
routingComponents,
|
routingComponents,
|
||||||
RankItemComponent,
|
|
||||||
SquadItemComponent],
|
SquadItemComponent],
|
||||||
bootstrap: [AppComponent]
|
bootstrap: [AppComponent]
|
||||||
})
|
})
|
||||||
|
|
|
@ -3,7 +3,6 @@ import {LoginComponent} from "./login/index";
|
||||||
import {NotFoundComponent} from "./common/not-found/not-found.component";
|
import {NotFoundComponent} from "./common/not-found/not-found.component";
|
||||||
import {LoginGuardAdmin, LoginGuardHL, LoginGuardMT, LoginGuardSQL} from "./login/login.guard";
|
import {LoginGuardAdmin, LoginGuardHL, LoginGuardMT, LoginGuardSQL} from "./login/login.guard";
|
||||||
import {squadsRoutes, squadsRoutingComponents} from "./squads/squads.routing";
|
import {squadsRoutes, squadsRoutingComponents} from "./squads/squads.routing";
|
||||||
import {ranksRoutes, ranksRoutingComponents} from "./ranks/ranks.routing";
|
|
||||||
import {armyRoutes, armyRoutingComponents} from "./army/army.routing";
|
import {armyRoutes, armyRoutingComponents} from "./army/army.routing";
|
||||||
import {SignupComponent} from "./login/signup.component";
|
import {SignupComponent} from "./login/signup.component";
|
||||||
import {RouteConfig} from "./app.config";
|
import {RouteConfig} from "./app.config";
|
||||||
|
@ -23,7 +22,7 @@ export const appRoutes: Routes = [
|
||||||
{path: RouteConfig.userPath, loadChildren: './users/users.module#UsersModule', canActivate: [LoginGuardHL]},
|
{path: RouteConfig.userPath, loadChildren: './users/users.module#UsersModule', canActivate: [LoginGuardHL]},
|
||||||
{path: RouteConfig.squadPath, children: squadsRoutes, canActivate: [LoginGuardHL]},
|
{path: RouteConfig.squadPath, children: squadsRoutes, canActivate: [LoginGuardHL]},
|
||||||
{path: RouteConfig.decorationPath, loadChildren: './decorations/decoration.module#DecorationsModule', canActivate: [LoginGuardHL]},
|
{path: RouteConfig.decorationPath, loadChildren: './decorations/decoration.module#DecorationsModule', canActivate: [LoginGuardHL]},
|
||||||
{path: RouteConfig.rankPath, children: ranksRoutes, canActivate: [LoginGuardHL]},
|
{path: RouteConfig.rankPath, loadChildren: './ranks/ranks.module#RanksModule', canActivate: [LoginGuardHL]},
|
||||||
|
|
||||||
{path: RouteConfig.adminPanelPath, loadChildren: './admin/admin.module#AdminModule', canActivate: [LoginGuardAdmin]},
|
{path: RouteConfig.adminPanelPath, loadChildren: './admin/admin.module#AdminModule', canActivate: [LoginGuardAdmin]},
|
||||||
|
|
||||||
|
@ -34,7 +33,6 @@ export const appRoutes: Routes = [
|
||||||
|
|
||||||
export const appRouting = RouterModule.forRoot(appRoutes);
|
export const appRouting = RouterModule.forRoot(appRoutes);
|
||||||
|
|
||||||
export const routingComponents = [LoginComponent, SignupComponent,
|
export const routingComponents = [LoginComponent, SignupComponent, ...armyRoutingComponents, NotFoundComponent, ...squadsRoutingComponents];
|
||||||
...armyRoutingComponents, NotFoundComponent, ...squadsRoutingComponents, ...ranksRoutingComponents];
|
|
||||||
|
|
||||||
export const routingProviders = [LoginGuardSQL, LoginGuardHL, LoginGuardMT, LoginGuardAdmin];
|
export const routingProviders = [LoginGuardSQL, LoginGuardHL, LoginGuardMT, LoginGuardAdmin];
|
||||||
|
|
|
@ -0,0 +1,15 @@
|
||||||
|
import {NgModule} from "@angular/core";
|
||||||
|
import {rankRouterModule, ranksRoutingComponents} from "./ranks.routing";
|
||||||
|
import {SharedModule} from "../shared.module";
|
||||||
|
import {CommonModule} from "@angular/common";
|
||||||
|
import {RankService} from "../services/rank-service/rank.service";
|
||||||
|
import {RankStore} from "../services/stores/rank.store";
|
||||||
|
|
||||||
|
@NgModule({
|
||||||
|
declarations: ranksRoutingComponents,
|
||||||
|
imports: [CommonModule, SharedModule, rankRouterModule],
|
||||||
|
providers: [RankStore, RankService]
|
||||||
|
})
|
||||||
|
export class RanksModule {
|
||||||
|
static routes = rankRouterModule;
|
||||||
|
}
|
|
@ -1,7 +1,9 @@
|
||||||
import {Routes} from "@angular/router";
|
import {RouterModule, Routes} from "@angular/router";
|
||||||
import {RankComponent} from "./ranks.component";
|
import {RankComponent} from "./ranks.component";
|
||||||
import {RankListComponent} from "./rank-list/rank-list.component";
|
import {RankListComponent} from "./rank-list/rank-list.component";
|
||||||
import {EditRankComponent} from "./edit-rank/edit-rank.component";
|
import {EditRankComponent} from "./edit-rank/edit-rank.component";
|
||||||
|
import {RankItemComponent} from "./rank-list/rank-item.component";
|
||||||
|
import {ModuleWithProviders} from "@angular/core";
|
||||||
|
|
||||||
|
|
||||||
export const ranksRoutes: Routes = [{
|
export const ranksRoutes: Routes = [{
|
||||||
|
@ -24,5 +26,7 @@ export const ranksRoutes: Routes = [{
|
||||||
outlet: 'right'
|
outlet: 'right'
|
||||||
}];
|
}];
|
||||||
|
|
||||||
export const ranksRoutingComponents = [RankComponent, RankListComponent, EditRankComponent];
|
export const rankRouterModule: ModuleWithProviders = RouterModule.forChild(ranksRoutes);
|
||||||
|
|
||||||
|
export const ranksRoutingComponents = [RankComponent, RankItemComponent, RankListComponent, EditRankComponent];
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue