mirror of https://github.com/sindresorhus/awesome
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
22 lines
682 B
TypeScript
22 lines
682 B
TypeScript
import { ErrorHandler, NgModule, Provider } from '@angular/core';
|
|
import { environment } from '../../environments/environment';
|
|
import { GlobalErrorHandlerService } from './error/global-error-handler.service';
|
|
import { UncaughtErrorComponent } from './error/uncaught-error.component';
|
|
import { PageNotFoundComponent } from './not-found/not-found.component';
|
|
|
|
const providers: Provider[] = [];
|
|
|
|
if (environment.production) {
|
|
// register prod error handler
|
|
providers.push({ provide: ErrorHandler, useClass: GlobalErrorHandlerService });
|
|
}
|
|
|
|
@NgModule({
|
|
declarations: [
|
|
PageNotFoundComponent,
|
|
UncaughtErrorComponent
|
|
],
|
|
providers
|
|
})
|
|
export class ErrorRoutingModule { }
|