问题描述
限时送ChatGPT账号..文档说
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
、default
、submit
.还有其他人吗?完整列表是否记录在任何地方?
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/angular/angular.js/blob/master/src/ng/directive/ngModel.js#L1188
角度来源:
if (modelCtrl.$options.getOption('updateOn')) {
element.on(modelCtrl.$options.getOption('updateOn'), function(ev) {
modelCtrl.$$debounceViewValueCommit(ev && ev.type);
});
}
这篇关于ngModelOptions 的 angular 的 updateOn 属性支持的事件的完整列表是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
更多推荐
[db:关键词]
发布评论