diff --git a/frontend/src/app/app.module.ts b/frontend/src/app/app.module.ts index 5ae0c6cb5..6ed7c43f9 100644 --- a/frontend/src/app/app.module.ts +++ b/frontend/src/app/app.module.ts @@ -1,5 +1,5 @@ import { BrowserModule, BrowserTransferStateModule } from '@angular/platform-browser'; -import { NgModule } from '@angular/core'; +import { ModuleWithProviders, NgModule } from '@angular/core'; import { HttpClientModule, HTTP_INTERCEPTORS } from '@angular/common/http'; import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; import { AppRoutingModule } from './app-routing.module'; @@ -20,6 +20,23 @@ import { ShortenStringPipe } from './shared/pipes/shorten-string-pipe/shorten-st import { CapAddressPipe } from './shared/pipes/cap-address-pipe/cap-address-pipe'; import { AppPreloadingStrategy } from './app.preloading-strategy'; +const providers = [ + ElectrsApiService, + StateService, + WebsocketService, + AudioService, + SeoService, + OpenGraphService, + StorageService, + EnterpriseService, + LanguageService, + ShortenStringPipe, + FiatShortenerPipe, + CapAddressPipe, + AppPreloadingStrategy, + { provide: HTTP_INTERCEPTORS, useClass: HttpCacheInterceptor, multi: true } +]; + @NgModule({ declarations: [ AppComponent, @@ -32,22 +49,17 @@ import { AppPreloadingStrategy } from './app.preloading-strategy'; BrowserAnimationsModule, SharedModule, ], - providers: [ - ElectrsApiService, - StateService, - WebsocketService, - AudioService, - SeoService, - OpenGraphService, - StorageService, - EnterpriseService, - LanguageService, - ShortenStringPipe, - FiatShortenerPipe, - CapAddressPipe, - AppPreloadingStrategy, - { provide: HTTP_INTERCEPTORS, useClass: HttpCacheInterceptor, multi: true } - ], + providers: providers, bootstrap: [AppComponent] }) export class AppModule { } + +@NgModule({}) +export class MempoolSharedModule{ + static forRoot(): ModuleWithProviders { + return { + ngModule: AppModule, + providers: providers + }; + } +}