angular/angular.js — pull request #1509 by PeteAppleton (2012-10-30 13:49:04+00:00)
Title: fix(removePatch): fire $destroy event when full jQuery is used

This patch corrects a problem observed when using ngRepeat to create required inputs inside a form. If the user removed the text from an input (making it invalid) and then carried out an action to delete the appropriate part of the model then the input element was never removed from the form, causing the form to stay $invalid although in fact all current elements were $valid. Because the form then had an invalid validation token retained for a destroyed control it was not possible to recover the correct state for the form without destroying it.

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.