Friday, 15 April 2011

angular ui - AngularJS backspace keypress -



angular ui - AngularJS backspace keypress -

i need capture user's backspaces within input.

so i've done this:

<input type="text" ui-keypress="{8:'removetagonbackspace()'}" ng-model="searchstudent" />

and then, within controller i've done this, check if it's working:

$scope.removetagonbackspace = function() { console.log('here'); };

but not printing anything. wrong this? angular able capture backspaces?

got it!

<input type="text" ng-keydown="removetagonbackspace($event)" />

and:

$scope.removetagonbackspace = function (event) { if (event.keycode === 8) { console.log('here!'); } };

angularjs angular-ui keypress

No comments:

Post a Comment