在Angular 2中使用(按键)时,是否可以找出按下了哪个键?
例如
<input type=text (keypress)=eventHandler()/>
public eventHandler() {
//Some code
console.log(keyPressed);
}
Run Code Online (Sandbox Code Playgroud)
编辑:似乎我的命名约定有点偏.我不是指AngularJS 2,我的意思是带有打字稿的Angular 2.0.