Ng Ng Keydown
π
2026-06-20 | π Angular
# AngularJS `ng-keydown` Directive
[ AngularJS Reference](#)
* * *
## AngularJS Example
Code executed when a key is pressed:
{{count}}
[Try it Β»](#)
* * *
## Definition and Usage
The **ng-keydown** directive tells AngularJS what to do 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 execute.
The order of key press events:
1. Keydown
2. Keypress
3. Keyup
* * *
## Syntax
The , ,