import { Pipe , PipeTransform } from '@angular/core' ; @ Pipe ( { name : 'addtax' } ) export class AddTaxPipe implements PipeTransform { transform ( price ) { if ( price ) { return this . getTotalPrice ( price ) ; } return price ; } getTotalPrice ( price ) { console . log ( 'addtax pipe called' ) ; let total = price + ( price * .08 ) ; return total ; } }