import { NgModule , LOCALE_ID } from '@angular/core' ; import { registerLocaleData } from '@angular/common' ; import { HttpClientModule } from '@angular/common/http' ; import locale from '@angular/common/locales/en' ; import { BrowserModule , Title } from '@angular/platform-browser' ; import { ServiceWorkerModule } from '@angular/service-worker' ; import { FaIconLibrary } from '@fortawesome/angular-fontawesome' ; import { NgxWebstorageModule } from 'ngx-webstorage' ; import dayjs from 'dayjs/esm' ; import { NgbDateAdapter , NgbDatepickerConfig } from '@ng-bootstrap/ng-bootstrap' ; import { ApplicationConfigService } from 'app/core/config/application-config.service' ; import './config/dayjs' ; import { SharedModule } from 'app/shared/shared.module' ; import { TranslationModule } from 'app/shared/language/translation.module' ; import { AppRoutingModule } from './app-routing.module' ; import { HomeModule } from './home/home.module' ; import { NgbDateDayjsAdapter } from './config/datepicker-adapter' ; import { fontAwesomeIcons } from './config/font-awesome-icons' ; import { httpInterceptorProviders } from 'app/core/interceptor/index' ; import { MainComponent } from './layouts/main/main.component' ; import { NavbarComponent } from './layouts/navbar/navbar.component' ; import { FooterComponent } from './layouts/footer/footer.component' ; import { PageRibbonComponent } from './layouts/profiles/page-ribbon.component' ; import { ActiveMenuDirective } from './layouts/navbar/active-menu.directive' ; import { ErrorComponent } from './layouts/error/error.component' ; @ NgModule ( { imports : [ BrowserModule , SharedModule , HomeModule , AppRoutingModule , ServiceWorkerModule . register ( 'ngsw-worker.js' , { enabled : false } ) , HttpClientModule , NgxWebstorageModule . forRoot ( { prefix : 'jhi' , separator : '-' , caseSensitive : true } ) , TranslationModule , ] , providers : [ Title , { provide : LOCALE_ID , useValue : 'en' } , { provide : NgbDateAdapter , useClass : NgbDateDayjsAdapter } , httpInterceptorProviders , ] , declarations : [ MainComponent , NavbarComponent , ErrorComponent , PageRibbonComponent , ActiveMenuDirective , FooterComponent ] , bootstrap : [ MainComponent ] , } ) export class AppModule { constructor ( applicationConfigService , iconLibrary , dpConfig ) { applicationConfigService . setEndpointPrefix ( SERVER_API_URL ) ; registerLocaleData ( locale ) ; iconLibrary . addIcons ( ... fontAwesomeIcons ) ; dpConfig . minDate = { year : dayjs ( ) . subtract ( 100 , 'year' ) . year ( ) , month : 1 , day : 1 } ; } }