typescript中与javascript中的下一行在语义上等价的语法是什么
//Some knockout event handler.
myFunc(data : string, evt : Event) {
//If enter or tab key up were detected add the excuse to the collection.
if(evt.enterKey || evt.which == 9)
//Do Something
}
这里的问题是,与常规javascript事件不同,typescript事件类没有属性enterKey
或which
.那么,如何在不出现typescript编译错误和难看的红色摇摆下划线的情况下检测按下了哪个键呢?