argos/dmp-frontend/src/app/app.module.ts

96 lines
3.9 KiB
TypeScript
Raw Normal View History

2018-01-30 10:35:26 +01:00
import { TranslateHttpLoader } from '@ngx-translate/http-loader';
import { BaseHttpService } from './utilities/cite-http-service-module/base-http.service';
import { DashboardService } from './services/dashboard/dashboard.service';
import { DatasetService } from './services/dataset/dataset.service';
import { AuthService } from './services/auth/auth.service';
import { AuthGuard } from './guards/auth.guard';
import { PaginationService } from './services/pagination.service';
import { VisibilityRulesService } from './visibility-rules/visibility-rules.service';
import { MaterialModule } from './shared/material/material.module';
import { TranslateLoader, TranslateModule } from '@ngx-translate/core';
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
import { AppRoutingModule } from './app-routing.module';
import { CommonModule } from '@angular/common';
import { HttpClient, HttpClientModule } from '@angular/common/http';
import { HttpModule } from '@angular/http';
2018-01-10 17:05:23 +01:00
import { HostConfiguration } from './app.constants';
import { LoginOptions } from './user-management/utilties/LoginOptions';
import { LoginModule } from './user-management/login.module';
2018-01-30 10:35:26 +01:00
import { DataManagementPlanModule } from './dmps/dmps.module';
import { DynamicFormModule } from './form/dynamic-form.module';
import { DatasetModule } from './datasets/dataset.module';
import { ProjectsModule } from './projects/projects.module';
import { SharedModule } from './shared/shared.module';
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
import { BrowserModule } from '@angular/platform-browser';
import { FigurecardComponent } from './shared/components/figurecard/figurecard.component';
2018-01-08 12:44:48 +01:00
import { InvitationAcceptedComponent } from './invitation-accepted/invitation-accepted.component';
2018-01-05 16:40:19 +01:00
import { InvitationComponent } from './invitation/invitation.component';
2017-11-27 14:40:16 +01:00
import { HomepageComponent } from './homepage/homepage.component';
2018-01-30 10:35:26 +01:00
import { PageNotFoundComponent } from './not-found.component';
import { AppComponent } from './app.component';
import { NgModule } from "@angular/core";
import { DatasetProfileModule } from './dataset-profile-form/dataset-profile.module';
2017-12-14 17:43:57 +01:00
@NgModule({
declarations: [
AppComponent,
2017-11-03 18:57:06 +01:00
PageNotFoundComponent,
2018-01-30 10:35:26 +01:00
HomepageComponent
],
imports: [
BrowserModule,
ReactiveFormsModule,
2017-12-14 11:41:26 +01:00
SharedModule,
FormsModule,
2018-01-10 17:05:23 +01:00
LoginModule.forRoot({
loginProviders: [
LoginOptions.facebookOauth,
LoginOptions.googleOauth,
LoginOptions.nativeLogin,
2018-01-11 12:13:01 +01:00
LoginOptions.linkedInOauth,
LoginOptions.twitterOauth
2018-01-10 17:05:23 +01:00
],
facebookConfiguration: { clientId: "110586756143149" },
googleConfiguration: { clientId: '524432312250-sc9qsmtmbvlv05r44onl6l93ia3k9deo.apps.googleusercontent.com' },
linkedInConfiguration: {
clientId: "86bl8vfk77clh9",
oauthUrl: "https://www.linkedin.com/oauth/v2/authorization",
redirectUri: HostConfiguration.App + "login/linkedin",
accessTokenUri: "https://www.linkedin.com/oauth/v2/accessToken",
clientSecret: "2OCO9e3wKylW05Tt"
2018-01-11 12:13:01 +01:00
},
twitterConfiguration: { clientId: "HiR4hQH9HNubKC5iKQy0l4mAZ", oauthUrl: "https://api.twitter.com/oauth/authenticate" }
2018-01-10 17:05:23 +01:00
}),
HttpModule,
2017-09-26 17:16:04 +02:00
HttpClientModule,
2017-11-03 18:57:06 +01:00
CommonModule,
2017-10-18 14:50:12 +02:00
AppRoutingModule,
2017-12-05 17:56:21 +01:00
BrowserAnimationsModule,
2017-12-14 11:41:26 +01:00
TranslateModule.forRoot({
loader: {
provide: TranslateLoader,
useFactory: HttpLoaderFactory,
deps: [HttpClient]
}
}),
BrowserAnimationsModule,
MaterialModule
],
2017-12-19 15:09:49 +01:00
providers: [
2017-12-19 18:34:00 +01:00
AuthService,
DashboardService,
2017-12-14 18:13:28 +01:00
BaseHttpService
2017-11-27 14:40:16 +01:00
],
bootstrap: [AppComponent]
})
export class AppModule {
constructor() {
}
}
2017-12-14 11:41:26 +01:00
export function HttpLoaderFactory(httpClient: HttpClient) {
return new TranslateHttpLoader(httpClient, 'assets/lang/', '.json');
}