import { BrowserModule } from '@angular/platform-browser' ; import { NgModule , LOCALE_ID , CUSTOM_ELEMENTS_SCHEMA , APP_INITIALIZER , ErrorHandler , Injectable } from '@angular/core' ; import localeNb from '@angular/common/locales/nb' ; import { registerLocaleData } from '@angular/common' ; import * as Sentry from '@sentry/browser' ; import { CoreModule } from '@core/core.module' ; import { SharedModule } from '@shared/shared.module' ; import { MaterialModule } from '@shared/material.module' ; import { AppRoutingModule } from './app-routing.module' ; import { AppComponent } from './app.component' ; import { BrowserAnimationsModule } from '@angular/platform-browser/animations' ; import { HomeModule } from './features/home/home.module' ; import { AboutModule } from './features/about/about.module' ; import { ProfileModule } from './features/profile/profile.module' ; import { ConfigService } from '@app/config.service' ; import { SettingsModule } from './features/settings/settings.module' ; export function initializeApp ( appInitService ) { return ( ) : Promise < any > => { return appInitService . Init ( ) ; } ; } registerLocaleData ( localeNb ) ; Sentry . init ( { dsn : 'https://ec12a75c643b47a6b5a881cec08c374d@sentry.io/1889115' } ) ; @ Injectable ( ) export class SentryErrorHandler implements ErrorHandler { constructor ( ) { } handleError ( error ) { const eventId = Sentry . captureException ( error . originalError || error ) ; Sentry . showReportDialog ( { eventId } ) ; } } @ NgModule ( { declarations : [ AppComponent ] , imports : [ CoreModule , SharedModule , HomeModule , AboutModule , ProfileModule , SettingsModule , BrowserModule , BrowserAnimationsModule , AppRoutingModule , ] , providers : [ ConfigService , { provide : APP_INITIALIZER , useFactory : initializeApp , deps : [ ConfigService ] , multi : true } , { provide : LOCALE_ID , useValue : 'nb' } , ] , bootstrap : [ AppComponent ] , schemas : [ CUSTOM_ELEMENTS_SCHEMA ] } ) export class AppModule { }