将多个事件绑定到 angular 中的一个元素 2
Binding multiple events to an element in angular 2
这是我的组件模板
<input #emailId (focusout)="emailIdCheck(emailId.value)" #emailIDD (keydown.tab)="emailIdCheck(emailIDD.value)" type="text" placeholder="Your Email ID">
如您所见,我已将 focusout
事件和 keydown.tab (tab keydown)
事件绑定到我的组件 class.
中的一个方法
但是如果我想绑定多个事件,这看起来很难看并且不能很好地扩展。
有没有可能有类似下面的东西?
<input #emailId (focusout|keydown.tab)="emailIdCheck(emailId.value)" type="text" placeholder="Your Email ID">
免责声明:我几周前开始练习 angular2,现在还是新手
https://github.com/angular/angular/issues/6675
2016 年 10 月 3 日
not planned in a near future
这是我的组件模板
<input #emailId (focusout)="emailIdCheck(emailId.value)" #emailIDD (keydown.tab)="emailIdCheck(emailIDD.value)" type="text" placeholder="Your Email ID">
如您所见,我已将 focusout
事件和 keydown.tab (tab keydown)
事件绑定到我的组件 class.
但是如果我想绑定多个事件,这看起来很难看并且不能很好地扩展。
有没有可能有类似下面的东西?
<input #emailId (focusout|keydown.tab)="emailIdCheck(emailId.value)" type="text" placeholder="Your Email ID">
免责声明:我几周前开始练习 angular2,现在还是新手
https://github.com/angular/angular/issues/6675
2016 年 10 月 3 日
not planned in a near future