Angular可以使用捕获而不是冒泡来捕获事件吗? [英] Can Angular use capture rather than bubbling to catch events?

查看:57
本文介绍了Angular可以使用捕获而不是冒泡来捕获事件吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我某种程度上需要捕获方法来捕获触发的事件,但是默认情况下,模板中的($ event)是通过冒泡方法触发的.有什么地方可以改变它吗?

I somehow need capture method to catch triggered events, but ($event) in template is triggered in bubbling method by default. Is there somewhere to change it?

推荐答案

当前,只能强制性地添加事件处理程序.

Currently this can only be done adding event handlers imperatively.

尽管有计划在将来支持它

There are plans though to support that in the future

请参见

  • https://github.com/angular/angular/issues/11200
  • https://github.com/angular/angular/pull/13371
  • https://github.com/angular/angular/issues/13248

这篇关于Angular可以使用捕获而不是冒泡来捕获事件吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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