Angular: Empty Fiddle
http://angularjs.org/
by dain
HTML
<script src="http://code.angularjs.org/angular-1.0.1.js"></script>
<div ng-controller="MyCtrl">
<form name="test_form">
<p>
Start typing and enter a uppercase character. After that no more changes are registered.</p>
<p>If you start with an uppercase character no changes will be registered at all. Whenever ng-pattern is false it blocks ng-change.</p>
<br/>
<input ng-model="test" ng-change="log()" ng-pattern="/^[a-z]+$/" />
<br/>
Changes: {{logger}}
<br/>
Validation: {{test_form.$valid}}
</form>
</div>
JavaScript
var myApp = angular.module('myApp',[]);
//myApp.directive('myDirective', function() {});
//myApp.factory('myService', function() {});
function MyCtrl($scope) {
$scope.logger = 0;
$scope.log = function() {
$scope.logger += 1;
};
}