You might be interested in https://github.com/angular/angular.js/blob/master/src/ng/directive/input.js#L3 :)