import { ChangeDetectionStrategy , Component , HostBinding , HostListener } from '@angular/core' ; import { SettingsFeature , SettingsWindowService } from '@layout/service' ; import { MarketWindowService } from '@modules/market/service' ; @ Component ( { selector : 'app-market-window' , templateUrl : './market-window.component.html' , styleUrls : [ './market-window.component.scss' ] , changeDetection : ChangeDetectionStrategy . OnPush } ) export class MarketWindowComponent { constructor ( private readonly marketWindow , private readonly settings ) { } @ HostBinding ( 'class.filter-visible' ) public visible = false ; @ HostListener ( 'document:keydown.escape' ) public onKeydownHandler ( ) { this . marketWindow . toggle ( ) . subscribe ( ) ; } public onFilterVisible ( visible ) { this . visible = visible ; } public onToggle ( ) { this . marketWindow . toggle ( ) . subscribe ( ) ; } public onToggleSettings ( ) { this . settings . toggle ( SettingsFeature . Market ) . subscribe ( ) ; } }