import { Component , Input , OnChanges , SimpleChanges } from '@angular/core' ; import { MonitorModel } from '@shared/models/index.model' ; /**
 * Monitor summary component
 */ @ Component ( { selector : 'dashboard-monitor-summary' , templateUrl : './monitor-summary.component.html' , styleUrls : [ './monitor-summary.component.scss' ] , } ) export class MonitorSummaryComponent implements OnChanges { @ Input ( 'monitors' ) public monitors : MonitorModel [ ] = [ ] ; param isValid public filterBy ( isValid ) { return this . monitors . filter ( ( monitor ) => { if ( monitor && monitor . latestPing ) { return monitor . latestPing . isValid === isValid ; } } ) ; } param changes ngOnChanges ( changes ) { this . monitors = changes . monitors . currentValue ; } }