Merge pull request #2572 from mempool/simon/adding-shared-app-module

Adding MempoolSharedModule
This commit is contained in:
wiz 2022-09-22 07:52:14 +09:00 committed by GitHub
commit 2e0afefe63
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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<MempoolSharedModule> {
return {
ngModule: AppModule,
providers: providers
};
}
}