2017-09-26 17:16:04 +02:00
|
|
|
import { NgModule } from '@angular/core';
|
|
|
|
import { RouterModule, Routes } from '@angular/router';
|
|
|
|
import { PageNotFoundComponent } from './not-found.component';
|
|
|
|
import { DynamicFormComponent } from './form/dynamic-form.component';
|
|
|
|
import { AuthGuard } from './guards/auth.guard';
|
2017-09-28 17:05:46 +02:00
|
|
|
import { ProjectsComponent } from './projects/projects.component';
|
2017-10-18 18:30:39 +02:00
|
|
|
import { DatasetsComponent } from './datasets/dataset.component';
|
2017-11-01 18:18:27 +01:00
|
|
|
import { DmpComponent } from './dmps/dmp.component';
|
|
|
|
import { AppComponent } from './app.component';
|
|
|
|
import { MainSignInComponent } from './login/main-sign-in/main-sign-in.component';
|
2017-09-26 17:16:04 +02:00
|
|
|
|
|
|
|
const appRoutes: Routes = [
|
2017-09-28 17:05:46 +02:00
|
|
|
{ path: 'dynamic-form', component: DynamicFormComponent, canActivate: [AuthGuard] },
|
2017-11-01 18:18:27 +01:00
|
|
|
{ path: 'login-page', component: MainSignInComponent},
|
|
|
|
{ path: 'projects', component: ProjectsComponent},
|
|
|
|
{ path: 'dmps', component: DmpComponent},
|
2017-09-26 17:16:04 +02:00
|
|
|
{ path: '', redirectTo: '/login-page', pathMatch: 'full' },
|
2017-11-01 18:18:27 +01:00
|
|
|
{ path: '**', component: PageNotFoundComponent },
|
|
|
|
{
|
|
|
|
path: '',
|
|
|
|
redirectTo: 'app-root',
|
|
|
|
pathMatch: 'full'
|
|
|
|
}
|
|
|
|
|
2017-09-26 17:16:04 +02:00
|
|
|
];
|
|
|
|
|
|
|
|
@NgModule({
|
|
|
|
imports: [
|
|
|
|
RouterModule.forRoot(
|
2017-10-10 16:10:00 +02:00
|
|
|
appRoutes
|
|
|
|
// { enableTracing: true } // <-- debugging purposes only
|
|
|
|
)
|
2017-09-26 17:16:04 +02:00
|
|
|
],
|
|
|
|
exports: [
|
|
|
|
RouterModule
|
|
|
|
],
|
|
|
|
providers: [
|
|
|
|
|
|
|
|
]
|
|
|
|
})
|
2017-11-01 18:18:27 +01:00
|
|
|
export class AppRoutingModule { }
|
|
|
|
|