import { Pipe , PipeTransform } from '@angular/core' ; @ Pipe ( { name : 'isErrorResponsePipe' } ) export class IsErrorResponsePipe implements PipeTransform { transform ( value ) { if ( ! value || value === null ) { return false ; } if ( value . hasOwnProperty ( 'error' ) ) { return ( value . error . hasOwnProperty ( 'code' ) && value . error . hasOwnProperty ( 'message' ) ) ; } return false ; } }