ngclick 已弃用。流行的替代方案或解决方案?

ngclick deprecated. Popular alternative or solution?

我是 angular 的新手。 ng-click 似乎是一个非常核心的指令,我不明白如何在没有 ng-click 的情况下制作应用程序。我错过了什么吗?显然它已被弃用。文档将我指向 fastclick,但这不是 angular 实现。

是否有一种流行的、未弃用的方式来执行 ng-click 所做的事情?为此,我在 Bower 上找不到任何流行的软件包。谢谢。

由于在移动浏览器中使用时的延迟,

ng-click 仅在 ngTouch 模块中被弃用。

Beginning with Angular 1.5, this directive is deprecated and by default disabled. The directive will receive no further support and might be removed from future releases. If you need the directive, you can enable it with the $touchProvider#ngClickOverrideEnabled function. We also recommend that you migrate to FastClick. To learn more about the 300ms delay, this Telerik article gives a good overview.

核心 ng 模块中的

Regular ngClick 将不受影响。

如果您确实需要使用 fastclick 作为替代方案,可以使用几个 angular 包装版本。 One, Two.