Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

Angular detecting escape key press

@HostListener('document:keydown.escape', ['$event']) onKeydownHandler(event: KeyboardEvent) {
    console.log(event);
}
Comment

Angular detecting escape key press

const ESCAPE_KEYCODE = 27;

@HostListener('document:keydown', ['$event']) onKeydownHandler(event: KeyboardEvent) {
    if (event.keyCode === ESCAPE_KEYCODE) {
        // ...
    }
}
Comment

PREVIOUS NEXT
Code Example
Javascript :: js check for class in classList 
Javascript :: remove react native cli mac 
Javascript :: get h1 text javascript 
Javascript :: get text in select jquery 
Javascript :: jqeury cdn 
Javascript :: htaccess for react 
Javascript :: how to call create react app 
Javascript :: sort object by value javascript 
Javascript :: change onclick attribute javascript 
Javascript :: npm ERR! Missing script: "eject" react native 
Javascript :: filter using two array of objects 
Javascript :: javascript create text file 
Javascript :: javascript print numbers in the given range 
Javascript :: refresh page after success ajax 
Javascript :: js stop scrolling event 
Javascript :: serve a file in express 
Javascript :: mongoose unique 
Javascript :: javascript sort alphabetically 
Javascript :: js get current date 
Javascript :: convert array to json in js 
Javascript :: how to save data i mongi db 
Javascript :: document not intialized react js 
Javascript :: terminal text length nodejs 
Javascript :: write json file in node js 
Javascript :: simple AES encryption javascript 
Javascript :: react native run on specific emulator 
Javascript :: html to pdf node js background color 
Javascript :: add 2 microseconds to Date() js 
Javascript :: how to round double value in js 
Javascript :: jquery on scroll down 
ADD CONTENT
Topic
Content
Source link
Name
3+6 =