redoc/lib/utils/custom-error-handler.ts
2016-10-23 20:18:42 +03:00

13 lines
341 B
TypeScript

import { ErrorHandler, Injectable } from '@angular/core';
import { AppStateService } from '../services/app-state.service';
@Injectable()
export class CustomErrorHandler implements ErrorHandler {
constructor(private appState: AppStateService) {
}
handleError(error) {
console.log(error);
this.appState.error.next(error);
}
}