Monday, March 5, 2018

get at the key code stuff in an Angular 4 app

This, or perhaps a keydown event, goes in the template on an input control...

(keyup)="getKeyCode($event)"

 
 

And on the TypeScript side of a component...

getKeyCode(event:any):void {
   alert(event.keyCode);
}

No comments:

Post a Comment