I am using the following method to detect keypresses on a page. My plan is to detect when the Escape key is pressed and run a method if so. For the moment I am just attempti
Angular makes this easy with the @HostListener decorator. This is a function decorator that accepts an event name as an argument. When that event gets fired on the host element it calls the associated function.
@HostListener('document:keydown.escape', ['$event']) onKeydownHandler(event:
KeyboardEvent) {
this.closeBlade();
}