import { Pipe, PipeTransform } from '@angular/core'; import { LocaleService } from './locale.service'; @Pipe({name: 'locale'}) export class FarrisLocalePipe implements PipeTransform { constructor(public localeService: LocaleService) {} transform(name: any, defaultVal = '', customText = ''): any { if (!customText) { const r = this.localeService.getValue(name); return r ? r : defaultVal; } return customText; } }