import { Pipe , PipeTransform } from '@angular/core' ; @ Pipe ( { name : 'boolean' } ) export class BooleanPipe implements PipeTransform { constructor ( ) { } transform ( flag , args ) { return flag ? args [ 0 ] : args [ 1 ] ; } }