import { NgModule } from '@angular/core'; import { RouterModule, Routes } from '@angular/router'; import { PageNotFoundComponent } from './not-found.component'; import { HomepageComponent } from './homepage/homepage.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'; import { DmpDetailedComponent } from './viewers/dmp-detailed/dmp-detailed.component'; import { ProjectDetailedComponent } from './viewers/project-detailed/project-detailed.component'; const appRoutes: Routes = [ { path: 'dynamic-form', component: DynamicFormComponent, canActivate: [AuthGuard] }, { path: 'dataset', component: DatasetsComponent }, { path: 'login', component: MainSignInComponent}, { path: 'projects', component: ProjectsComponent}, { path: 'dmps', component: DmpComponent, children: [ { path: "dmp", component: DmpDetailedComponent, data: { //breadcrumb: "Sign In" } }, { path: "project", component: ProjectDetailedComponent, data: { //breadcrumb: "Sign Up" } } ] }, { path: 'welcome', component: HomepageComponent}, { path: '', redirectTo: '/login', pathMatch: 'full' }, { path: '**', component: PageNotFoundComponent } ]; @NgModule({ imports: [ RouterModule.forRoot( appRoutes ,{ useHash: true //,enableTracing: true <-- debugging purposes only } ) ], exports: [ RouterModule ], providers: [ ] }) export class AppRoutingModule { }