import { ChangeDetectionStrategy , Component , Input } from '@angular/core' ; param product @ Component ( { changeDetection : ChangeDetectionStrategy . OnPush , selector : 'shared-product-attribution' , styleUrls : [ './product-attribution.component.scss' ] , templateUrl : './product-attribution.component.html' } ) export class ProductAttributionComponent { @ Input ( ) product : any ; param product returns { Array < string > } getSources ( product ) { const sources = new Set < string > ( ) ; if ( ! product ) { return [ ] ; } if ( product . source ) { sources . add ( product . source . toLowerCase ( ) ) ; } if ( product . properties ) { [ 'origin-source' , 'magnitude-source' , 'beachball-source' ] . forEach ( prop => { if ( product . properties [ prop ] ) { sources . add ( product . properties [ prop ] . toLowerCase ( ) ) ; } } ) ; } return Array . from ( sources ) ; } param index param item trackByIndex ( index , item ) { return index ; } }