Skip to content

Commit

Permalink
refactor(ngsa-base): provide error handler in app config
Browse files Browse the repository at this point in the history
  • Loading branch information
jackofdiamond5 committed May 31, 2024
1 parent 574343b commit 7090586
Showing 1 changed file with 24 additions and 9 deletions.
Original file line number Diff line number Diff line change
@@ -1,19 +1,34 @@
import { ApplicationConfig, importProvidersFrom } from '@angular/core';
import { ApplicationConfig, ErrorHandler, Provider, importProvidersFrom } from '@angular/core';
import { provideRouter, withComponentInputBinding } from '@angular/router';
import { HammerModule } from '@angular/platform-browser';
import { BrowserModule, HammerModule } from '@angular/platform-browser';
import { provideAnimations } from '@angular/platform-browser/animations';
import { provideHttpClient } from '@angular/common/http';
import {
IgxNavigationDrawerModule,
IgxNavbarModule,
IgxLayoutModule,
IgxRippleModule,
} from 'igniteui-angular';

import { routes } from './app.routes';
import { GlobalErrorHandlerService } from './error-routing/error/global-error-handler.service';
import { environment } from '../environments/environment';

export const appConfig: ApplicationConfig = {
providers: [
const providers: Provider[] = [
[
provideRouter(routes, withComponentInputBinding()),
importProvidersFrom(HammerModule),
provideAnimations(),
provideHttpClient()
importProvidersFrom(BrowserModule),
provideAnimations()
// provide the HAMMER_GESTURE_CONFIG token
// to override the default settings of the HammerModule
// { provide: HAMMER_GESTURE_CONFIG, useClass: MyHammerConfig }
]
};
];

if (environment.production) {
providers.push({
provide: ErrorHandler,
useClass: GlobalErrorHandlerService
});
}

export const appConfig: ApplicationConfig = { providers };

0 comments on commit 7090586

Please sign in to comment.