import { Component , EventEmitter , Input , OnChanges , Output , SimpleChanges , } from '@angular/core' ; import { HsHistoryListService } from './history-list.service' ; @ Component ( { selector : 'hs-history-list' , templateUrl : './history-list.html' , } ) export class HsHistoryListComponent implements OnChanges { @ Input ( ) what : string ; @ Output ( ) historyUrlSelected = new EventEmitter < string > ( ) ; items : Array < string > ; constructor ( public HsHistoryListService ) { } ngOnChanges ( changes ) { this . items = this . HsHistoryListService . readSourceHistory ( changes . what . currentValue ) ; } historyUrlClicked ( value ) { this . historyUrlSelected . emit ( value ) ; } }