WEB DEVELOPER SITE
HTMLCSSJAVASCRIPTSQLPHPBOOTSTRAPJQUERYANGULARXML
 
.

AngularJS ng-keypress Directive


Example

Execute an articulation at each keystroke:

<input ng-keypress="count = check + 1" ng-init="count=0"/>

<h1>{{count}}</h1>
Try it yourself »

Definition and Usage

The ng-keypress mandate guides AngularJS when the console is utilized on the particular HTML element.

The ng-keypress mandate from AngularJS won't supersede the component's unique onkeypress occasion, both will be executed.

The request of a key stroke is:

1. Keydown

2. Keypress

3. Keyup


Syntax

<element ng-keypress="expression"></element>

Supported by <input>, <select>, <textarea>, and other editable elements.


Parameter Values

Value Description
expression An articulation to execute when a key is pressed.