dependencies Legend  Declarations  Module  Bootstrap  Providers  Exports cluster_RedboxPortalCoreModule cluster_RedboxPortalCoreModule_exports cluster_RedboxPortalCoreModule_declarations cluster_RedboxPortalCoreModule_providers HeaderSortComponent HeaderSortComponent RedboxPortalCoreModule RedboxPortalCoreModule HeaderSortComponent->RedboxPortalCoreModule RecordTableComponent RecordTableComponent RecordTableComponent->RedboxPortalCoreModule HeaderSortComponent HeaderSortComponent RedboxPortalCoreModule->HeaderSortComponent RecordTableComponent RecordTableComponent RedboxPortalCoreModule->RecordTableComponent AppConfigService AppConfigService AppConfigService->RedboxPortalCoreModule ConfigService ConfigService ConfigService->RedboxPortalCoreModule CsrfInterceptor CsrfInterceptor CsrfInterceptor->RedboxPortalCoreModule LoggerService LoggerService LoggerService->RedboxPortalCoreModule RecordService RecordService RecordService->RedboxPortalCoreModule ReportService ReportService ReportService->RedboxPortalCoreModule TranslationService TranslationService TranslationService->RedboxPortalCoreModule UserService UserService UserService->RedboxPortalCoreModule UtilityService UtilityService UtilityService->RedboxPortalCoreModule
import { NgModule, APP_INITIALIZER, LOCALE_ID } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { HttpClientModule, HTTP_INTERCEPTORS } from '@angular/common/http';
import { APP_BASE_HREF, PlatformLocation } from '@angular/common';
import { FormsModule } from "@angular/forms";
import { isEmpty as _isEmpty } from 'lodash-es';

import { I18NextModule } from 'angular-i18next';
import { PaginationModule } from 'ngx-bootstrap/pagination';

import { ConfigService } from './config.service';
import { UtilityService } from './utility.service';
import { AppConfigService } from './appconfig.service';
import { CsrfInterceptor } from './csrf.interceptor';
import { UserService } from './user.service';
import { LoggerService } from './logger.service';
import { RecordService } from './record.service';
import { TranslationService  } from './translation.service';
import { RecordTableComponent } from './record-table.component';
import { ReportService } from './report.service';
import { HeaderSortComponent } from "./header-sort.component";

export function trimLastSlashFromUrl(baseUrl: string) {
  if (!_isEmpty(baseUrl) && (baseUrl[baseUrl.length - 1] == '/')) {
    var trimmedUrl = baseUrl.substring(0, baseUrl.length - 1);
    return trimmedUrl;
  }
  return baseUrl;
}

@NgModule({
  declarations: [
    RecordTableComponent,
    HeaderSortComponent
  ],
  providers: [
    {
      provide: APP_BASE_HREF,
      useFactory: (s: PlatformLocation) => trimLastSlashFromUrl(s.getBaseHrefFromDOM()),
      deps: [PlatformLocation]
    },
    ConfigService,
    TranslationService,
    LoggerService,
    UtilityService,
    AppConfigService,
    {
      provide: HTTP_INTERCEPTORS,
      useClass: CsrfInterceptor,
      multi: true
    },
    UserService,
    RecordService,
    ReportService
  ],
  imports: [
    BrowserModule,
    HttpClientModule,
    FormsModule,
    I18NextModule.forRoot(),
    PaginationModule.forRoot()
  ],
  exports: [
    I18NextModule,
    PaginationModule,
    RecordTableComponent,
    HeaderSortComponent,
  ]
})
export class RedboxPortalCoreModule { }

results matching ""

    No results matching ""