Angular Keypress
Description
AngularJS directive to help bind keyboard events to methods in the scope.
Installation
npm install --save vi-angular-keypress
or
bower install vi-angular-keypress
Require the module:
;
Register the module into your main app module
angular;
Usage
In the template, use the vi-keypress
attribute on the element to bind methods for different keypress.
If the Enter key (char code 13) is pressed the method enterPressed is invoked in your scope, while if escape key (char code 27) is pressed the escapePressed method is invoked.