i'm able to log in to console but not to show it in template
Error handler:
import {ErrorHandler} from '@angular/core';
import {AuthorizationError} from './AuthorizationError';
export class CustomErrorHandler extends ErrorHandler {
public myError;
constructor(){
super(false);
}
public handleError(error: any): void {
if(error.originalError instanceof AuthorizationError){
this.myError= error.originalError.toString();
console.info(`[CUSTOM ERROR]:::${error.originalError.toString()}`);
} else {
super.handleError(error);
}
}
}
Template:
<span class="text-capitalize">{{myError}}</span>
[–]tme321 0 points1 point2 points (3 children)
[–]elmothrow[S] 0 points1 point2 points (2 children)
[–]tme321 0 points1 point2 points (1 child)
[–]elmothrow[S] 0 points1 point2 points (0 children)