AngularJS ng-keyupDirective
AngularJS Example
Code executed when a key is released:
<input ng-keyup="count = count + 1" ng-init="count=0" />
<h1>{{count}}</h1>
<h1>{{count}}</h1>
Try it Yourself »
Definition and Usage
ng-keyupThe directive is used to tell AngularJS what to do when a key is released on the specified HTML element.
ng-keyupThe directive does not override the element's native onkeyup event. When the event is triggered,ng-keyupboth the expression and the native onkeyup event will be executed.
Order of keyboard events:
- Keydown
- Keypress
- Keyup
Syntax
<element ng-keyup="expression"></element>
<input>, <select>, <textarea>, and other editable elements support this directive.
Parameter Value
| Value | Description |
|---|---|
| expression | The expression to execute when a key is released. |
Other Extensions
AngularJS Reference Manual