AngularJS ng-keyup Instruction
AngularJS Examples
Code to execute when a key is released:
<
input
ng-keyup="count = count + 1"
ng-init=
"count=0"
/
<
h1
{{count}}
<
/h1Try 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:
- Keydown
- Keypress
- Keyup
Syntax
<
element
ng-keyup=
"expression"
<
/element,
Parameter value
| Value | Description |
|---|---|
| expression | The expression to execute when a key is released. |
AngularJS Reference Manual