Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

AngularJS ng-keyup Directive

AngularJS ng-keyup Instruction

AngularJS Reference Manual AngularJS Reference Manual


AngularJS Examples

Code to execute when a key is released:

<

input

ng-keyup=

"count = count + 1"

ng-init=

"count=0"

/

<

h1

{{count}}

<

/h1

Try it »


Definition and Usage

ng-keyup The directive tells AngularJS the action to take when a key is released on the specified HTML element.

ng-keyup The directive does not override the element's native onkeyup event. When the event is triggered,ng-keyup both the expression and the native onkeyup event will be executed.

The event order of key strokes:

  1. Keydown
  2. Keypress
  3. Keyup

Syntax

<

element

ng-keyup=

"expression"

<

/element

,


Parameter value

Value Description
expression The expression to execute when a key is released.

AngularJS Reference Manual AngularJS Reference Manual