Updated routes and app component
This commit is contained in:
parent
f9fb93a57c
commit
c9cfb64c4e
|
@ -1,14 +1,30 @@
|
||||||
import { NgModule } from '@angular/core';
|
import {NgModule} from '@angular/core';
|
||||||
import { RouterModule, Routes } from '@angular/router';
|
import {RouterModule, Routes} from '@angular/router';
|
||||||
import {StatisticsComponent} from "./statistics/statistics.component";
|
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 = [
|
const routes: Routes = [
|
||||||
{ path: 'statistics', component: StatisticsComponent },
|
{path: 'statistics', component: StatisticsComponent},
|
||||||
{ path: '', redirectTo: 'statistics', pathMatch: 'full' }
|
{
|
||||||
|
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({
|
@NgModule({
|
||||||
imports: [RouterModule.forRoot(routes)],
|
imports: [RouterModule.forRoot(routes)],
|
||||||
exports: [RouterModule]
|
exports: [RouterModule]
|
||||||
})
|
})
|
||||||
export class AppRoutingModule { }
|
export class AppRoutingModule {
|
||||||
|
}
|
||||||
|
|
|
@ -1,22 +1,33 @@
|
||||||
import { NgModule } from '@angular/core';
|
import {NgModule} from '@angular/core';
|
||||||
import { BrowserModule } from '@angular/platform-browser';
|
import {BrowserModule} from '@angular/platform-browser';
|
||||||
|
import {FormsModule} from '@angular/forms';
|
||||||
|
|
||||||
import { AppRoutingModule } from './app-routing.module';
|
import {AppRoutingModule} from './app-routing.module';
|
||||||
import { AppComponent } from './app.component';
|
import {AppComponent} from './app.component';
|
||||||
import { NavbarComponent } from './navbar/navbar.component';
|
import {NavbarComponent} from './navbar/navbar.component';
|
||||||
import { StatisticsComponent } from './statistics/statistics.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({
|
@NgModule({
|
||||||
declarations: [
|
declarations: [
|
||||||
AppComponent,
|
AppComponent,
|
||||||
NavbarComponent,
|
NavbarComponent,
|
||||||
StatisticsComponent
|
StatisticsComponent,
|
||||||
|
AdministrationComponent,
|
||||||
|
FactionsComponent,
|
||||||
|
LoginComponent,
|
||||||
|
LogoutComponent
|
||||||
],
|
],
|
||||||
imports: [
|
imports: [
|
||||||
BrowserModule,
|
BrowserModule,
|
||||||
AppRoutingModule
|
AppRoutingModule,
|
||||||
|
FormsModule
|
||||||
],
|
],
|
||||||
providers: [],
|
providers: [],
|
||||||
bootstrap: [AppComponent]
|
bootstrap: [AppComponent]
|
||||||
})
|
})
|
||||||
export class AppModule { }
|
export class AppModule {
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in New Issue