Angular Latest: Empty Fiddle
http://angularjs.org/
by codef0rmer
HTML
<script src="https://code.angularjs.org/snapshot/angular.js"></script>
<div ng-controller="MyCtrl">
<input type="text" ng-model="foobar[$index].index" ng-repeat="foo in foobar" watch-order />
</div>
CSS
.popup {
background: gray;
margin: 10px auto;
}
.popup.large { width: 80%; }
.popup.small { width: 50%; }
.popup .title {
font-size: 2em;
}
JavaScript
var myApp = angular.module('myApp',[]);
myApp.controller('MyCtrl', function ($scope) {
$scope.foobar = [{
index: 0
}, {
index: 1
}, {
index: 2
}, {
index: 3
}]
$scope.$watch('foobar', function (newVal, oldVal) {
console.log(newVal, oldVal);
}, true);
});