import { NgModule } from '@angular/core' ; import { FormsModule } from '@angular/forms' ; import { BrowserModule } from '@angular/platform-browser' ; import { BrowserAnimationsModule } from '@angular/platform-browser/animations' ; import { HTTP_INTERCEPTORS , HttpClientModule } from '@angular/common/http' ; import { MatFormFieldModule } from '@angular/material/form-field' ; import { MatInputModule } from '@angular/material/input' ; import { MatCardModule } from '@angular/material/card' ; import { MatIconModule } from '@angular/material/icon' ; import { NgbDatepickerConfig , NgbModule , NgbTooltipConfig } from '@ng-bootstrap/ng-bootstrap' ; import { TranslateModule } from '@ngx-translate/core' ; import { OB_BANNER , ObAlertModule , ObDocumentMetaModule , ObDocumentMetaService , ObDropdownModule , ObErrorMessagesModule , ObExternalLinkModule , ObHttpApiInterceptor , ObHttpApiInterceptorConfig , ObHttpApiInterceptorModule , ObIconModule , ObInputClearModule , ObMasterLayoutConfig , ObMasterLayoutModule , ObMultiselectModule , ObNotificationModule , ObOffCanvasModule , ObSchemaValidationModule , ObScrollingModule , ObSearchBoxModule , ObSelectableModule , ObSpinnerModule , ObUnsavedChangesModule , ObUseObliqueIcons , multiTranslateLoader } from '@oblique/oblique' ; import { AppComponent } from './app.component' ; import { AppRoutingModule } from './app-routing.module' ; import { HomePageComponent } from './home/home.page' ; import { HttpMockErrorInterceptor } from './samples/http-interceptor/http-mock-error.interceptor' ; import { environment } from '../environments/environment' ; import { registerLocaleData } from '@angular/common' ; import localeFR from '@angular/common/locales/fr-CH' ; import { HttpInterceptorSampleComponent } from './samples/http-interceptor/http-interceptor-sample.component' ; import { FONTS , THEMES , ThemeService } from './common/theme.service' ; registerLocaleData ( localeFR ) ; @ NgModule ( { declarations : [ AppComponent , HomePageComponent ] , imports : [ ObIconModule . forRoot ( ) , BrowserModule , BrowserAnimationsModule , FormsModule , HttpClientModule , NgbModule , ObAlertModule , ObDocumentMetaModule , ObErrorMessagesModule , ObExternalLinkModule , ObDropdownModule , ObHttpApiInterceptorModule , ObMasterLayoutModule , ObMultiselectModule , ObNotificationModule , ObOffCanvasModule , ObSchemaValidationModule , ObScrollingModule , ObSearchBoxModule , ObSelectableModule , ObSpinnerModule , ObUnsavedChangesModule , TranslateModule . forRoot ( multiTranslateLoader ( ) ) , AppRoutingModule , ObMasterLayoutModule , MatFormFieldModule , MatInputModule , MatIconModule , MatCardModule , ObInputClearModule ] , providers : [ { provide : OB_BANNER , useValue : environment . banner } , { provide : HTTP_INTERCEPTORS , useClass : ObHttpApiInterceptor , multi : true } , { provide : HTTP_INTERCEPTORS , useClass : HttpMockErrorInterceptor , multi : true } , { provide : ObUseObliqueIcons , useValue : true } ] , bootstrap : [ AppComponent ] } ) export class AppModule { constructor ( private readonly tooltipConfig , private readonly datepickerConfig , private readonly documentMetaService , interceptorConfig , config , theme ) { documentMetaService . titleSuffix = 'i18n.application.title' ; documentMetaService . description = 'i18n.application.description' ; tooltipConfig . container = 'body' ; datepickerConfig . navigation = 'arrows' ; interceptorConfig . api . url = HttpInterceptorSampleComponent . API_URL ; config . locale . locales = [ 'en-us' , 'fr-CH' ] ; config . layout . hasOffCanvas = true ; theme . setTheme ( THEMES . MATERIAL ) ; theme . setFont ( FONTS . FRUTIGER ) ; } }