import { Pipe , PipeTransform } from '@angular/core' ; import { TranslateService } from './translate.service' ; @ Pipe ( { name : 'translate' , pure : false } ) export class TranslatePipe implements PipeTransform { constructor ( private translate ) { } transform ( value , args ) { if ( ! value ) return ; return this . translate . instant ( value ) ; } }