是什么的$实际用途破坏jqLit​​e的事件(或AngularJS-修补jQuery的)? [英] What are practical uses of the $destroy event of jqLite (or AngularJS-patched jQuery)?

查看:83
本文介绍了是什么的$实际用途破坏jqLit​​e的事件(或AngularJS-修补jQuery的)?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

首先,我想明确的是,我的问题是的的有关$毁灭与AngularJS范围相关联的事件。

First all, I want to be clear that my question is NOT about the $destroy event associated with AngularJS Scope.

AngularJS补丁jQuery来让所有jQuery的DOM API的破坏所有的DOM节点被移除以触发 $摧毁事件。 jqLit​​e(自带AngularJS)的行为也以同样的方式,如果没有使用jQuery的。我已经看到了使用 $摧毁事件在AngularJS源少数事件(即绑定)。不过,我仍然不能理什么的被删除结合对DOM元素的 $摧毁事件的一些实际用途。请赐教。

AngularJS patches jQuery to make all jQuery's DOM destruction apis to fire a $destroy event on all DOM nodes being removed. jqLite (comes with AngularJS) also behaves in the same way, if no jQuery is used. I have seen the $destroy event been used (ie. bind to) in a few occurrences in AngularJS' source. But still, I cannot reason what are some practical uses of binding to the $destroy event on DOM elements being removed. Please enlighten me.

推荐答案

下面是可能与此事件解决的AngularJS GitHub的库有效的问题:的 https://github.com/angular/angular.js/issues/3237

Here is a valid issue from the AngularJS github repository that could be solved with this event: https://github.com/angular/angular.js/issues/3237

这篇关于是什么的$实际用途破坏jqLit​​e的事件(或AngularJS-修补jQuery的)?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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