import { Pipe , PipeTransform } from '@angular/core' ; import { GtConfigTotal } from '../interfaces/gt-config-total' ; @ Pipe ( { name : 'gtTotalsPosition' } ) export class GtTotalsPositionPipe implements PipeTransform { transform ( array , position = 'header' ) { return array . filter ( total => { const totalPosition = total . position ? total . position : 'header' ; return totalPosition === position ; } ) ; } }