import { Component , OnDestroy , OnInit } from '@angular/core' ; import { Subscription } from 'rxjs' ; import { EventService } from '@core/event.service' ; import { WaveformService } from '../waveform.service' ; /**
 * Create event page that links to IRIS products/ waveform data
 *
 */ @ Component ( { selector : 'executive-waveforms' , styleUrls : [ './waveforms.component.scss' ] , templateUrl : './waveforms.component.html' } ) export class WaveformsComponent implements OnInit , OnDestroy { event : any ; subscription : Subscription ; constructor ( public eventService , public waveformService ) { } ngOnDestroy ( ) { this . subscription . unsubscribe ( ) ; } ngOnInit ( ) { this . subscription = this . eventService . event$ . subscribe ( event => { if ( event && event . id ) { this . event = event ; this . waveformService . getIrisEvent ( event ) ; } } ) ; } }