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

Commit

Permalink
docs(jqLite): explain what monkey-patching jQuery.cleanData does
Browse files Browse the repository at this point in the history
  • Loading branch information
mgol committed May 11, 2014
1 parent d71dbb1 commit 7f5e0f0
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/Angular.js
Original file line number Diff line number Diff line change
Expand Up @@ -1449,6 +1449,9 @@ function bindJQuery() {
// Prevent double-proxying.
originalCleanData = originalCleanData.$$original || originalCleanData;

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

0 comments on commit 7f5e0f0

Please sign in to comment.