angular/angular.js — pull request #1512 by PeteAppleton (2012-10-31 12:48:31+00:00)
Title: fix(removePatch): fire $destroy event when full jQuery is used

We found an issue where jQuery 1.8.2 is used where form controls created by ngRepeat are never removed from the parent form because the $destroy custom event is not fired. As a result, if a control was invalid (due to the model binding) and then destroyed the form's validity state became out-of-sync with the model and impossible to restore. This patch corrects the issue.

The previous code relied upon internal jQuery structures which are not
present in v.1.8.2 (current). This code uses the public API to fire the
$destroy custom event, and so should work with any post-1.4 jQuery
version.