Identify event source from ng-change on ng-repeat item

Problem

If I have....

<ul>
   <li ng-repeat="s in collection">
     <select ng-change="update()">
        <option></option>
     </select>
   </li>
</ul>

How do I get a reference to the specific select that raises a call to update()?

Problem courtesy of: Ian Warburton

Solution

Like this & heres the fiddle:

<div ng-controller="MyCtrl">
  <ul>
   <li ng-repeat="s in collection">
     Hello I am {{s.name}} & these are my options
     <select ng-options="o as o for o in s.options" ng-model="s.selectedOption" ng-change="optionChanged()">
     </select>
   </li>
</ul>
</div>

<script>
var myApp = angular.module('myApp',[]);

function MyCtrl($scope) {
    $scope.collection = [
        {'name':'one', 'value':1, 'options':['A','B']},
        {'name':'two', 'value':2, 'options':['C','D']}
    ];

    $scope.optionChanged = function(){
        console.debug(this.s.selectedOption);
    }
}
</script>
Solution courtesy of: marko

Discussion

There is currently no discussion for this recipe.

This recipe can be found in it's original form on Stack Over Flow.