YouTip LogoYouTip

Ng Ng Keypress

# AngularJS `ng-keypress` Directive [![Image 3: AngularJS Reference](#) AngularJS Reference](#) * * * ## AngularJS Example Code executed when a key is pressed:

{{count}}

[Try it Β»](#) * * * ## Definition and Usage The **ng-keypress** directive tells AngularJS what to do when a key is pressed on a specified HTML element. The **ng-keypress** directive does not override the element's native onkeypress event. When the event triggers, both the **ng-keypress** expression and the native onkeypress event will execute. The order of key press events: 1. Keydown 2. Keypress 3. Keyup * * * ## Syntax The ``, ``, `