Trying to monitor keyboard events with Angular 2 using TypeScript and What is Angular2 way of creating global keyboard shortcuts (a.k.a. hotkeys)? was helpful but tslint (co
import {HostListener} from '@angular/core';
@HostListener('window:keydown', ['$event'])
handleKeyDown(event: KeyboardEvent) {
// event.key === 'ArrowUp'
}
@HostBindings('attr.foo') foo = 'bar'
is to bind values from your component instance to the host element like class
, attributes, properties or styles.