ng-keydown
Handler for keydown event
Description
The ng-keydown directive allows you to specify custom behavior when pressing
keys, regardless of whether they produce a character value.
Parameters
ng-keydown
Type: Expression
Description: Expression to evaluate upon keydown event. KeyboardEvent object is available as
$event.Example:
<div ng-keydown="$ctrl.greet($event)"></div>
Demo
<section ng-app>
<input
type="text"
ng-keydown="count = count + 1"
ng-init="count = 0"
placeholder="Click here, then press down a key."
/>
Keydown {{ count }} times
</section>
Feedback
Was this page helpful?
Glad to hear it! Please tell us how we can improve.
Sorry to hear that. Please tell us how we can improve.