Page MenuHomec4science

app.module.ts
No OneTemporary

File Metadata

Created
Sun, Jun 29, 12:50

app.module.ts

import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { HttpClientModule } from '@angular/common/http';
import { FormsModule } from '@angular/forms';
import { RouterModule, Routes } from '@angular/router';
import { AppComponent } from './app.component';
import { ProfileComponent } from './profile/profile.component';
import { LoginComponent } from './login/login.component';
import { RegisterComponent } from './register/register.component';
import { HomeComponent } from './home/home.component';
import { AuthenticationService } from './authentication.service';
import { AuthGuardService } from './auth-guard.service';
import { AdminComponent } from './admin/admin.component';
import { ResultsComponent } from './results/results.component';
import { SurveylistComponent } from './surveylist/surveylist.component';
import { NewsurveyComponent } from './newsurvey/newsurvey.component';
import { HierarchyComponent } from './hierarchy/hierarchy.component';
import { RespondentsComponent } from './respondents/respondents.component';
import { ResultComponent } from './result/result.component';
import { SurveyV1Module } from './survey-v1/survey-v1.module';
import { PageNotFoundComponent } from './page-not-found/page-not-found.component';
import { SurveyV2Module } from './survey-v2/survey-v2.module';
import { HashLocationStrategy, LocationStrategy } from '@angular/common';
const routes: Routes = [
{ path: 'login', component: LoginComponent },
{ path: 'register', component: RegisterComponent },
{ path: 'profile', component: ProfileComponent, canActivate: [AuthGuardService] },
{ path: 'admin', component: AdminComponent, canActivate: [AuthGuardService] },
{ path: 'results', component: ResultsComponent , canActivate: [AuthGuardService]},
{ path: 'surveylist', component: SurveylistComponent , canActivate: [AuthGuardService]},
{ path: 'newsurvey', component: NewsurveyComponent , canActivate: [AuthGuardService]},
{ path: 'respondents', component: RespondentsComponent , canActivate: [AuthGuardService]},
{ path: 'result', component: ResultComponent , canActivate: [AuthGuardService]},
{ path: 'hierarchy', component: HierarchyComponent , canActivate: [AuthGuardService]},
{ path: '**', component: PageNotFoundComponent }
];
@NgModule({
declarations: [
AppComponent,
ProfileComponent,
LoginComponent,
RegisterComponent,
HomeComponent,
AdminComponent,
ResultsComponent,
SurveylistComponent,
NewsurveyComponent,
HierarchyComponent,
RespondentsComponent,
ResultComponent,
PageNotFoundComponent
],
imports: [
BrowserModule,
FormsModule,
HttpClientModule,
RouterModule.forRoot(routes),
SurveyV1Module,
SurveyV2Module
],
providers: [
AuthenticationService,
AuthGuardService,
{provide: LocationStrategy, useClass: HashLocationStrategy}
],
bootstrap: [AppComponent]
})
export class AppModule { }

Event Timeline