ngModelOptions 的 angular 的 updateOn 属性支持的事件的完整列表是什么?

编程入门 行业动态 更新时间:2024-10-23 13:32:09
本文介绍了ngModelOptions 的 angular 的 updateOn 属性支持的事件的完整列表是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

限时送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.

页面提到了几个事件:blurdefaultsubmit.还有其他人吗?完整列表是否记录在任何地方?

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:关键词]

本文发布于:2023-04-21 10:28:19,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1000474.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:属性   完整   事件   列表   ngModelOptions

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!