import { ChangeDetectionStrategy , Component , Input } from '@angular/core' ; param product @ Component ( { changeDetection : ChangeDetectionStrategy . OnPush , selector : 'shared-link-product' , styleUrls : [ './link-product.component.scss' ] , templateUrl : './link-product.component.html' } ) export class LinkProductComponent { @ Input ( ) product : any ; param product returns { string } getText ( product ) { try { const text = product . properties . text ; return text ; } catch ( e ) { return 'no text' ; } } param product returns { string } getUrl ( product ) { try { const url = product . properties . url ; if ( product . contents [ url ] ) { return product . contents [ url ] . url ; } return url ; } catch ( e ) { return '#nourl' ; } } }