Adding Window.event Handler To Typescript


Answer :

This

window.addEventListener('keydown', keyDownListener, false) 

window is defined will all events in lib.d.ts and this particular listener as

 addEventListener(type: "keydown", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; 

or this, if you want to keep your original "style",

window.onkeydown = (ev: KeyboardEvent): any => {      //do something } 

Comments

Popular posts from this blog

Converting A String To Int In Groovy

"Cannot Create Cache Directory /home//.composer/cache/repo/https---packagist.org/, Or Directory Is Not Writable. Proceeding Without Cache"

Android How Can I Convert A String To A Editable