import { Component , OnInit , Input , Output , EventEmitter } from '@angular/core' ; import { HistoryService } from '../../services/history.service' ; import { QueryService } from '../../services/query.service' ; @ Component ( { selector : 'app-query-history' , templateUrl : './query-history.component.html' , styleUrls : [ './query-history.component.scss' ] } ) export class QueryHistoryComponent implements OnInit { @ Output ( ) fetch = new EventEmitter ( ) ; historyEntries = this . historySrv . history ; constructor ( public historySrv , private query ) { } ngOnInit ( ) { } async setAndFetch ( entry ) { await this . query . setFullQuery ( entry ) ; this . fetch . emit ( ) ; } }