import { ChangeDetectionStrategy , Component , Input , OnChanges } from '@angular/core' ; import { Subscription } from 'rxjs' ; import { ContentsXmlService } from '@core/contents-xml.service' ; param product { Product } @ Component ( { changeDetection : ChangeDetectionStrategy . OnPush , selector : 'product-page-download' , styleUrls : [ './download.component.scss' ] , templateUrl : './download.component.html' } ) export class DownloadComponent implements OnChanges { @ Input ( ) expanded : any ; @ Input ( ) product : any ; subscription : Subscription ; constructor ( public contentsXmlService ) { } /**
     * Gets contents xml from product
     */ loadContentsXml ( ) { if ( this . product && this . product . phasedata ) { this . product = this . product . phasedata ; } this . contentsXmlService . get ( this . product ) ; } /**
     * The product's contents xml needs to be fetched when switching between
     * products in the header's summary view
     */ ngOnChanges ( ) { this . loadContentsXml ( ) ; } param index param item trackByIndex ( index , item ) { return index ; } }