33 lines
1.4 KiB
TypeScript
33 lines
1.4 KiB
TypeScript
import { NgModule } from '@angular/core';
|
|
import { Routes, RouterModule } from '@angular/router';
|
|
|
|
import { AuthGuard, AuthUpdateGuard, AuthenticatedGuard, AnonymousGuard } from './auth/auth.guard';
|
|
import { PageEntry } from './pages/entry/entry.page';
|
|
import { PageLogin } from './pages/login/login.page';
|
|
import { PageNew } from './pages/new/new.page';
|
|
import { PageNotFound} from './pages/notfound/notfound.page';
|
|
import { PageSettings } from './pages/settings/settings.page';
|
|
import { PageSubmission } from './pages/submission/submission.page';
|
|
import { PageTop } from './pages/top/top.page';
|
|
import { UiMain } from './ui/main/main.ui';
|
|
|
|
|
|
const routes: Routes = [
|
|
{
|
|
path: '', component: UiMain, children: [
|
|
{ path: '', component: PageTop, canActivate: [ AuthenticatedGuard ] },
|
|
{ path: 'e/:id', component: PageEntry, canActivate: [ AuthenticatedGuard ] },
|
|
{ path: 'new', component: PageNew, canActivate: [ AuthenticatedGuard ] },
|
|
{ path: 'submit', component: PageSubmission, canActivate: [ AuthenticatedGuard ] },
|
|
{ path: 'login', component: PageLogin, canActivate: [ AnonymousGuard ] },
|
|
{ path: 'settings', component: PageSettings, canActivate: [ AuthenticatedGuard ] },
|
|
]
|
|
},
|
|
];
|
|
|
|
@NgModule({
|
|
imports: [ RouterModule.forRoot(routes, { onSameUrlNavigation: 'reload', relativeLinkResolution: 'legacy' }) ],
|
|
exports: [ RouterModule ]
|
|
})
|
|
export class AppRoutingModule { }
|