AngularJS: API: ng/directive/ngKeyup


ngKeyup

  1. - directive in module ng

Specify custom behavior on keyup event.

Directive Info

  • This directive executes at priority level 0.

Usage

  • as attribute:
    <ANY
      ng-keyup="">
    ...
    </ANY>

Arguments

ParamTypeDetails
ngKeyupexpression

Expression to evaluate upon keyup. (Event object is available as $event and can be interrogated for keyCode, altKey, etc.)

Example

index.html
<p>Typing in the input box below updates the key count</p><input ng-keyup="count = count + 1" ng-init="count=0"> key up count: {{count}}

<p>Typing in the input box below updates the keycode</p><input ng-keyup="event=$event"><p>event keyCode: {{ event.keyCode }}</p><p>event altKey: {{ event.altKey }}</p>