import { ChangeDetectionStrategy , Component , Input } from '@angular/core' ; import { FormatterService } from '@core/formatter.service' ; import { Tensor } from '@shared/beachball/tensor' ; param event @ Component ( { changeDetection : ChangeDetectionStrategy . OnPush , selector : 'technical-moment-tensor-summary' , styleUrls : [ './moment-tensor-summary.component.scss' ] , templateUrl : './moment-tensor-summary.component.html' } ) export class MomentTensorSummaryComponent { _products : Array < any > ; columnsToDisplay = [ 'catalog' , 'tensor' , 'magnitude' , 'depth' , 'percentDC' , 'source' ] ; @ Input ( ) event : any ; tensors : Array < any > = [ ] ; constructor ( public formatterService ) { } param products returns { Tensor } @ Input ( ) set products ( products ) { this . _products = products ; this . tensors = ( products || [ ] ) . map ( p => { return Tensor . fromProduct ( p ) ; } ) ; } returns { Array < any > } get products ( ) { return this . _products ; } }