Angularjs Examples

AJS Examples


AngularJS ng-KeyDown Directive

The AngularJS ng-keydown directive is used to attach specific functionality on keydown event.

Syntax

<button ng-keydown="addFunctionality"> 

AngularJS ng-KeyDown Directive Example

<html ng-app>
<head>
<script src= "http://ajax.googleapis.com/ajax/libs/angularjs/1.2.26/angular.min.js"></script>
</head>
<body>
<input ng-keydown="count = count + 1" ng-init="count=0">
    key down count: {{count}}
</div>
</body>
</html>
See Live Example