import { Pipe , ChangeDetectorRef , Injectable } from '@angular/core' ; import { TranslatePipe , TranslateService } from '@ngx-translate/core' ; @ Injectable ( ) @ Pipe ( { name : 'nullableTranslate' } ) export class NullableTranslatePipe extends TranslatePipe { constructor ( translate , _ref ) { super ( translate , _ref ) ; } transform ( query , ... args ) { let result = super . transform ( query , ... args ) ; if ( result == query ) { if ( args != null && args [ 0 ] . default ) { return args [ 0 ] . default ; } else { if ( args [ 0 ] . Title ) { return args [ 0 ] . Title ; } else { return result ; } } } else { return result ; } } }