Open Wiljanneman opened 3 years ago
I believe the lib should log erros on console in development mode...
try/catch
probably, and:
import { ErrorHandler } from '@angular/core';
@Injectable()
export class GlobalErrorHandler implements ErrorHandler {
constructor(
private $gaService: GoogleAnalyticsService
) {}
handleError(error) {
// your custom error handling logic
this.$gaService.event('error', 'globalErrorHandler', 'Trololo');
}
}
...
@NgModule({
providers: [{provide: ErrorHandler, useClass: GlobalErrorHandler}]
})
Hi I was wondering if it were possible to globally log any errors on a window via the event function? Or do you have any suggestions perhaps?
Thanks in advance!