Could not get your directive to work. This is what I ended up with:
.directive('keyboardPoster', ['$timeout', function($timeout) { var DELAY_TIME_BEFORE_POSTING = 200; return function(scope, elem, attrs) { var element = angular.element(elem)[0]; var currentTimeout = null; element.oninput = function() { var poster = scope[attrs.postFunction]; if(currentTimeout) { $timeout.cancel(currentTimeout) } currentTimeout = $timeout(function() { poster(angular.element(element).val()); }, DELAY_TIME_BEFORE_POSTING); } } }]);
Could not get your directive to work. This is what I ended up with: