Ng Ng Keydown
π
2026-06-19 | π Angular
# AngularJS `ng-keydown` Directive
[ AngularJS Reference Manual](#)
* * *
## AngularJS Example
Code executed when a key is pressed:
{{count}}
[Try it Β»](#)
* * *
## Definition and Usage
The **ng-keydown** directive is used to tell AngularJS what operation to perform when a key is pressed on a specified HTML element.
The **ng-keydown** directive does not override the element's native onkeydown event. When the event is triggered, both the **ng-keydown** expression and the native onkeydown event will be executed.
The order of key press events:
1. Keydown
2. Keypress
3. Keyup
* * *
## Syntax
, ,