error-explorer-angular-reporter
Version:
Advanced Angular SDK for Error Explorer - Comprehensive error tracking and monitoring with offline support, rate limiting, security validation, and real-time analytics
39 lines (38 loc) • 1.24 kB
text/typescript
import { NgModule, ModuleWithProviders, ErrorHandler } from '@angular/core';
import { HttpClientModule, HTTP_INTERCEPTORS } from '@angular/common/http';
import { ErrorExplorerConfig, ERROR_EXPLORER_CONFIG } from './types';
import { ErrorExplorerService } from './services/error-explorer.service';
import { ErrorExplorerErrorHandler } from './error-handler';
import { ErrorExplorerHttpInterceptor } from './http-interceptor';
import { BatchManagerService } from './services/batch-manager.service';
import { CompressionService } from './services/compression.service';
({
imports: [HttpClientModule],
providers: [
ErrorExplorerService,
BatchManagerService,
CompressionService
]
})
export class ErrorExplorerModule {
static forRoot(config: ErrorExplorerConfig): ModuleWithProviders<ErrorExplorerModule> {
return {
ngModule: ErrorExplorerModule,
providers: [
{
provide: ERROR_EXPLORER_CONFIG,
useValue: config
},
{
provide: ErrorHandler,
useClass: ErrorExplorerErrorHandler
},
{
provide: HTTP_INTERCEPTORS,
useClass: ErrorExplorerHttpInterceptor,
multi: true
}
]
};
}
}