diff --git a/projects/speech-statistics/src/app/app-routing.module.ts b/projects/speech-statistics/src/app/app-routing.module.ts index 4f77a86..161129f 100644 --- a/projects/speech-statistics/src/app/app-routing.module.ts +++ b/projects/speech-statistics/src/app/app-routing.module.ts @@ -1,14 +1,30 @@ -import { NgModule } from '@angular/core'; -import { RouterModule, Routes } from '@angular/router'; +import {NgModule} from '@angular/core'; +import {RouterModule, Routes} from '@angular/router'; import {StatisticsComponent} from "./statistics/statistics.component"; +import {AdministrationComponent} from './auth/administration/administration.component'; +import {FactionsComponent} from './auth/administration/factions/factions.component'; +import {LoginComponent} from './login/login.component'; +import {LogoutComponent} from './logout/logout.component'; +import {AuthGuard} from './auth/auth.guard'; const routes: Routes = [ - { path: 'statistics', component: StatisticsComponent }, - { path: '', redirectTo: 'statistics', pathMatch: 'full' } + {path: 'statistics', component: StatisticsComponent}, + { + path: 'administration', + component: AdministrationComponent, + children: [ + {path: 'factions', component: FactionsComponent}, + ], + canActivate: [AuthGuard] + }, + {path: 'login', component: LoginComponent}, + {path: 'logout', component: LogoutComponent, canActivate: [AuthGuard]}, + {path: '', redirectTo: 'statistics', pathMatch: 'full'} ]; @NgModule({ imports: [RouterModule.forRoot(routes)], exports: [RouterModule] }) -export class AppRoutingModule { } +export class AppRoutingModule { +} diff --git a/projects/speech-statistics/src/app/app.module.ts b/projects/speech-statistics/src/app/app.module.ts index eb0ce2e..9d0c4c7 100644 --- a/projects/speech-statistics/src/app/app.module.ts +++ b/projects/speech-statistics/src/app/app.module.ts @@ -1,22 +1,33 @@ -import { NgModule } from '@angular/core'; -import { BrowserModule } from '@angular/platform-browser'; +import {NgModule} from '@angular/core'; +import {BrowserModule} from '@angular/platform-browser'; +import {FormsModule} from '@angular/forms'; -import { AppRoutingModule } from './app-routing.module'; -import { AppComponent } from './app.component'; -import { NavbarComponent } from './navbar/navbar.component'; -import { StatisticsComponent } from './statistics/statistics.component'; +import {AppRoutingModule} from './app-routing.module'; +import {AppComponent} from './app.component'; +import {NavbarComponent} from './navbar/navbar.component'; +import {StatisticsComponent} from './statistics/statistics.component'; +import {LoginComponent} from './login/login.component'; +import {AdministrationComponent} from './auth/administration/administration.component'; +import {FactionsComponent} from './auth/administration/factions/factions.component'; +import {LogoutComponent} from './logout/logout.component'; @NgModule({ declarations: [ AppComponent, NavbarComponent, - StatisticsComponent + StatisticsComponent, + AdministrationComponent, + FactionsComponent, + LoginComponent, + LogoutComponent ], imports: [ BrowserModule, - AppRoutingModule + AppRoutingModule, + FormsModule ], providers: [], bootstrap: [AppComponent] }) -export class AppModule { } +export class AppModule { +}