import { Pipe , PipeTransform } from '@angular/core' ; @ Pipe ( { name : 'winPercentage' } ) export class WinPercentagePipe implements PipeTransform { transform ( value ) { console . log ( 'In winPercentage pipe' ) ; return value . wins / ( value . wins + value . losses ) ; } }