I have to create one service that will log any run-time error occurred in the application.
I have created a service named "ErrorHandlingService" and below given code is written
import { ErrorHandler } from '@angular/core';
export class ErrorhandlingService implements ErrorHandler {
handleError(error: any): void {
console.error('Some error occured: ', error);
}
}
In app.module.ts I have written the below code
@NgModule({
declarations: [AppComponent],
entryComponents: [],
providers: [StatusBar, SplashScreen,
{ provide: RouteReuseStrategy, useClass: IonicRouteStrategy },
{ provide: ErrorHandler, useClass: ErrorhandlingService },
bootstrap: [AppComponent],
})
But still the default error is shown
@Injectable()