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'; import { ProjectsComponent } from './projects/projects.component'; import { DatasetsComponent } from './datasets/dataset.component'; import { DmpComponent } from './dmps/dmp.component'; import { AppComponent } from './app.component'; import { MainSignInComponent } from './login/main-sign-in/main-sign-in.component'; const appRoutes: Routes = [ { path: 'dynamic-form', component: DynamicFormComponent, canActivate: [AuthGuard] }, { path: 'login-page', component: MainSignInComponent}, { path: 'projects', component: ProjectsComponent}, { path: 'dmps', component: DmpComponent}, { path: '', redirectTo: '/login-page', pathMatch: 'full' }, { path: '**', component: PageNotFoundComponent }, { path: '', redirectTo: 'app-root', pathMatch: 'full' } ]; @NgModule({ imports: [ RouterModule.forRoot( appRoutes // { enableTracing: true } // <-- debugging purposes only ) ], exports: [ RouterModule ], providers: [ ] }) export class AppRoutingModule { }