import { Pipe , PipeTransform } from '@angular/core' ; @ Pipe ( { name : 'chargesPenaltyFilter' } ) export class ChargesPenaltyFilterPipe implements PipeTransform { transform ( charges , penalty ) { if ( charges ) { charges = charges . filter ( ( charge ) => { if ( charge . penalty === penalty ) { return true ; } return false ; } ) ; } return charges ; } }