Add ranks module

pull/7/head
Florian Hartwich 2017-09-03 12:37:42 +02:00
parent b2dd827f98
commit 711e82e6cc
4 changed files with 23 additions and 8 deletions

View File

@ -9,7 +9,6 @@ import {SquadStore} from "./services/stores/squad.store";
import {DecorationStore} from "./services/stores/decoration.store";
import {DecorationService} from "./services/decoration-service/decoration.service";
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 {RankService} from "./services/rank-service/rank.service";
import {AppConfig} from "./app.config";
@ -45,7 +44,6 @@ import {BrowserAnimationsModule} from "@angular/platform-browser/animations";
declarations: [
AppComponent,
routingComponents,
RankItemComponent,
SquadItemComponent],
bootstrap: [AppComponent]
})

View File

@ -3,7 +3,6 @@ import {LoginComponent} from "./login/index";
import {NotFoundComponent} from "./common/not-found/not-found.component";
import {LoginGuardAdmin, LoginGuardHL, LoginGuardMT, LoginGuardSQL} from "./login/login.guard";
import {squadsRoutes, squadsRoutingComponents} from "./squads/squads.routing";
import {ranksRoutes, ranksRoutingComponents} from "./ranks/ranks.routing";
import {armyRoutes, armyRoutingComponents} from "./army/army.routing";
import {SignupComponent} from "./login/signup.component";
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.squadPath, children: squadsRoutes, 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]},
@ -34,7 +33,6 @@ export const appRoutes: Routes = [
export const appRouting = RouterModule.forRoot(appRoutes);
export const routingComponents = [LoginComponent, SignupComponent,
...armyRoutingComponents, NotFoundComponent, ...squadsRoutingComponents, ...ranksRoutingComponents];
export const routingComponents = [LoginComponent, SignupComponent, ...armyRoutingComponents, NotFoundComponent, ...squadsRoutingComponents];
export const routingProviders = [LoginGuardSQL, LoginGuardHL, LoginGuardMT, LoginGuardAdmin];

View File

@ -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;
}

View File

@ -1,7 +1,9 @@
import {Routes} from "@angular/router";
import {RouterModule, Routes} from "@angular/router";
import {RankComponent} from "./ranks.component";
import {RankListComponent} from "./rank-list/rank-list.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 = [{
@ -24,5 +26,7 @@ export const ranksRoutes: Routes = [{
outlet: 'right'
}];
export const ranksRoutingComponents = [RankComponent, RankListComponent, EditRankComponent];
export const rankRouterModule: ModuleWithProviders = RouterModule.forChild(ranksRoutes);
export const ranksRoutingComponents = [RankComponent, RankItemComponent, RankListComponent, EditRankComponent];