Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

Commit 7f5e0f0

Browse files
committed
docs(jqLite): explain what monkey-patching jQuery.cleanData does
1 parent d71dbb1 commit 7f5e0f0

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/Angular.js

+3
Original file line numberDiff line numberDiff line change
@@ -1449,6 +1449,9 @@ function bindJQuery() {
14491449
// Prevent double-proxying.
14501450
originalCleanData = originalCleanData.$$original || originalCleanData;
14511451

1452+
// All nodes removed from the DOM via various jQuery APIs like .remove()
1453+
// are passed through jQuery.cleanData. Monkey-patch this method to fire
1454+
// the $destroy event on all removed nodes.
14521455
jQuery.cleanData = function(elems) {
14531456
for (var i = 0, elem; (elem = elems[i]) != null; i++) {
14541457
jQuery(elem).triggerHandler('$destroy');

0 commit comments

Comments
 (0)