import { OverlayModule } from '@angular/cdk/overlay'; import { HttpClient, HttpClientModule } from '@angular/common/http'; import { LOCALE_ID, NgModule } from '@angular/core'; import { FormsModule, ReactiveFormsModule } from '@angular/forms'; import { MatMomentDateModule, MAT_MOMENT_DATE_FORMATS } from '@angular/material-moment-adapter'; import { DateAdapter, MAT_DATE_FORMATS, MAT_DATE_LOCALE } from '@angular/material/core'; import { BrowserModule, Title } from '@angular/platform-browser'; import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; import { AppRoutingModule } from '@app/app-routing.module'; import { AppComponent } from '@app/app.component'; import { CoreServiceModule } from '@app/core/core-service.module'; import { CultureService } from '@app/core/services/culture/culture-service'; import { NotificationModule } from '@app/library/notification/notification.module'; import { LoginModule } from '@app/ui/auth/login/login.module'; import { DatasetCreateWizardModule } from '@app/ui/dataset-create-wizard/dataset-create-wizard.module'; import { BreadcrumbModule } from '@app/ui/misc/breadcrumb/breadcrumb.module'; import { HelpContentModule } from '@app/ui/misc/help-content/help-content.module'; import { NavigationModule } from '@app/ui/misc/navigation/navigation.module'; import { NavbarModule } from '@app/ui/navbar/navbar.module'; import { SidebarModule } from '@app/ui/sidebar/sidebar.module'; import { MomentUtcDateAdapter } from '@common/date/moment-utc-date-adapter'; import { CommonHttpModule } from '@common/http/common-http.module'; import { CommonUiModule } from '@common/ui/common-ui.module'; import { TranslateLoader, TranslateModule } from '@ngx-translate/core'; import { TranslateHttpLoader } from '@ngx-translate/http-loader'; import { environment } from 'environments/environment'; import { CookieService } from 'ngx-cookie-service'; import { NgcCookieConsentConfig, NgcCookieConsentModule } from 'ngx-cookieconsent'; // AoT requires an exported function for factories export function HttpLoaderFactory(http: HttpClient) { return new TranslateHttpLoader(http, 'assets/i18n/', '.json'); } const cookieConfig: NgcCookieConsentConfig = { enabled: true, cookie: { domain: environment.App // or 'your.domain.com' // it is mandatory to set a domain, for cookies to work properly (see https://goo.gl/S2Hy2A) }, palette: { popup: { background: "#000000", text: "#ffffff", link: "#ffffff" }, button: { background: "#00b29f", text: "#ffffff", border: "transparent" } }, content: { message: "This website uses cookies to enhance the user experience.", dismiss: "Got it!", deny: "Refuse cookies", link: "Learn more", href: environment.App + "terms-of-service", policy: "Cookie Policy" }, position: "bottom-right", theme: 'edgeless', type: 'info' }; @NgModule({ imports: [ BrowserModule, BrowserAnimationsModule, CoreServiceModule.forRoot(), AppRoutingModule, CommonUiModule, TranslateModule.forRoot({ loader: { provide: TranslateLoader, useFactory: HttpLoaderFactory, deps: [HttpClient] } }), HttpClientModule, OverlayModule, CommonHttpModule, MatMomentDateModule, LoginModule, //Ui NotificationModule, NavigationModule, BreadcrumbModule, HelpContentModule, ReactiveFormsModule, FormsModule, DatasetCreateWizardModule, NavbarModule, SidebarModule, NgcCookieConsentModule.forRoot(cookieConfig) ], declarations: [ AppComponent ], providers: [ { provide: MAT_DATE_LOCALE, deps: [CultureService], useFactory: (cultureService) => cultureService.getCurrentCulture().name }, { provide: MAT_DATE_FORMATS, useValue: MAT_MOMENT_DATE_FORMATS }, { provide: DateAdapter, useClass: MomentUtcDateAdapter }, { provide: LOCALE_ID, deps: [CultureService], useFactory: (cultureService) => cultureService.getCurrentCulture().name }, Title, CookieService ], bootstrap: [AppComponent] }) export class AppModule { }