AngularJs ng-keydown event example


AngularJs ng-keydown event example : AngularJs ng-keydown event binds keydown event with elements in html.


Syntax for AngularJs ng-keydown event example

The below example shows the ng-keydown event directive.

Example

<!DOCTYPE html>
<html lang="en">
<head>
    <script src="//ajax.googleapis.com/ajax/libs/angularjs/1.4.3/angular.min.js"></script>
</head>

<body>
<div ng-app="" ng-init="i=0">
    <input type="text" ng-keydown="i = i+1" placeholder="Type something...">
     Counter = {{i}}
</div>
</body>
</html>

Try it »

AngularJs ng-keydown event example

AngularJs ng-keydown event example


Advertisements

Add Comment

📖 Read More