redoc/lib/utils/custom-error-handler.ts

13 lines
341 B
TypeScript
Raw Normal View History

2016-10-23 20:18:42 +03:00
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);
}
}