import { ModuleWithProviders, NgModule, Optional, SkipSelf } from '@angular/core'; import { Configuration } from './configuration'; import { HttpClient } from '@angular/common/http'; import { DebugControllerService } from './api/debugController.service'; import { DictionaryControllerService } from './api/dictionaryController.service'; import { FileManagementControllerService } from './api/fileManagementController.service'; import { LicenseReportControllerService } from './api/licenseReportController.service'; import { ManualRedactionControllerService } from './api/manualRedactionController.service'; import { ProjectControllerService } from './api/projectController.service'; import { ReanalysisControllerService } from './api/reanalysisController.service'; import { RedactionLogControllerService } from './api/redactionLogController.service'; import { RulesControllerService } from './api/rulesController.service'; import { StatusControllerService } from './api/statusController.service'; import { UserControllerService } from './api/userController.service'; import { VersionsControllerService } from './api/versionsController.service'; import { ViewedPagesControllerService } from './api/viewedPagesController.service'; import { LegalBasisMappingControllerService } from './api/legalBasisMappingController.service'; import { WatermarkControllerService } from './api/watermarkController.service'; import { RuleSetControllerService } from './api/ruleSetController.service'; import { DownloadControllerService } from './api/downloadController.service'; import { DigitalSignatureControllerService } from './api/digitalSignatureController.service'; import { AuditControllerService } from './api/auditController.service'; import { FileAttributesControllerService } from './api/fileAttributesController.service'; import { SmtpConfigurationControllerService } from './api/smtpConfigurationController.service'; @NgModule({ imports: [], declarations: [], exports: [], providers: [ AuditControllerService, DebugControllerService, DictionaryControllerService, FileManagementControllerService, LicenseReportControllerService, ManualRedactionControllerService, ProjectControllerService, ReanalysisControllerService, RedactionLogControllerService, RuleSetControllerService, RulesControllerService, UserControllerService, StatusControllerService, VersionsControllerService, ViewedPagesControllerService, LegalBasisMappingControllerService, WatermarkControllerService, DownloadControllerService, DigitalSignatureControllerService, FileAttributesControllerService, SmtpConfigurationControllerService ] }) export class ApiModule { constructor(@Optional() @SkipSelf() parentModule: ApiModule, @Optional() http: HttpClient) { if (parentModule) { throw new Error('ApiModule is already loaded. Import in your base AppModule only.'); } if (!http) { throw new Error('You need to import the HttpClientModule in your AppModule! \n' + 'See also https://github.com/angular/angular/issues/20575'); } } public static forRoot(configurationFactory: () => Configuration): ModuleWithProviders { return { ngModule: ApiModule, providers: [{ provide: Configuration, useFactory: configurationFactory }] }; } }