angular/angular.js — pull request #2651 by OrenAvissar (2013-05-14 04:54:03+00:00)
Title: feat(ngRepeat): Add "watch with" option to track added, moved, and remov...

Added a `watch with` option to `ngRepeat`. This makes it easier to perform operations, such as animation, on the entire set of elements instead of watching them individually. The watcher function is called at the end of ngRepeat and is passed an array of all the added, moved, and removed elements each time the bound data is modified.

The tag usage is:

```html

{{thing}}

```

This would correspond to a method defined in the scope:

```javascript
$scope.myRepeatWatcher = function (addedElements, movedElements, removedElements, done) {

// Do stuff

done();
}

```

I created a demo to show some of the ways this can be used.

[View Demo on Plnkr](http://plnkr.co/5vKvpqgK6GVPhlsjKHl1)

Any advise and feedback is welcome!

I'm still not sure if it's better to pass the added, moved and removed arrays as separate parameters or if a single object with properties should be passed in. I think separate parameters is simple and clear but an object would allow additional information to be passed back in the future without changing the interface.

I still need to add docs and tests.