AngularJS ng-keydown instruction
AngularJS examples
Press the button to execute the code:
<Input ng-keydown = "count = count + 1" ng-init = "count = 0" />
<H1> {{count}} </ h1>
<H1> {{count}} </ h1>
try it"
Definition and Usage
ng-keydown tell AngularJS instructions for operating a key is pressed on the specified HTML element needed.
Nativeng-keydown directive does not cover elements onkeydown event, the event is triggered, ng-keydownexpression and native onkeydown event will be executed.
Button tap sequence of events:
- Keydown
- Keypress
- Keyup
grammar
<Element ng-keydown = "expression "> </ element>
<Input>, <select>, <textarea>, and other editable elements support this instruction.
Parameter Value
value | description |
---|---|
expression | Press the button to execute the expression. |