ngModelOptions的angular的updateOn属性支持的完整事件列表是什么? [英] What is the complete list of events supported by angular's updateOn property of ngModelOptions?

查看:541
本文介绍了ngModelOptions的angular的updateOn属性支持的完整事件列表是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

文档


updateOn:指定输入绑定到哪个事件的字符串。您可以使用空格分隔列表设置多个事件。有一个名为default的特殊事件与属于该控件的默认事件匹配。

updateOn: string specifying which event should the input be bound to. You can set several events using an space delimited list. There is a special event called default that matches the default events belonging of the control.

该页面提到了一些事件: blur 默认提交。还有其他人吗?完整列表是否记录在任何地方?

The page mentions a few events: blur, default, submit. Are there any others? Is the full list documented anywhere?

推荐答案

据我所知,您可以将任何可用的DOM事件绑定到 updateOn 属性。查看完整列表此处

As far as i know, you can bind any available DOM event to the updateOn property. see a full list here.

查看 ngModel 的来源,可以看到传递给 updateOn 的选项将被绑定到实际元素本身。

Having a look at the Source of ngModel, you can see that the options passed to updateOn will get bound to the actual element itself.

https://github.com/angular/angular.js/blob/master/src/ng/directive/ngModel.js#L1188

Angular来源:

Angular Source:

if (modelCtrl.$options.getOption('updateOn')) {
  element.on(modelCtrl.$options.getOption('updateOn'), function(ev) {
    modelCtrl.$$debounceViewValueCommit(ev && ev.type);
  });
}

这篇关于ngModelOptions的angular的updateOn属性支持的完整事件列表是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆