Angular input directive 1.2.0
HTML
<script src="http://code.angularjs.org/1.2.0/angular.min.js"></script>
<div ng-controller="MyCtrl">{{ timesChanged }}
<br/>
<input type="text" ng-model="string"></input>
</div>
JavaScript
var app = angular.module('myApp', []);
function MyCtrl($scope) {
$scope.string = 'Hello.';
$scope.timesChanged = 0;
$scope.$watch('string', function (newValue) {
$scope.timesChanged++;
});
$scope.string = 'How are you';
$scope.string = 'doing today?';
}