vi-angular-keypress
v1.0.3
Published
AngularJS directive to help bind keyboard events to methods in the scope.
Downloads
12
Maintainers
Readme
Angular Keypress
Description
AngularJS directive to help bind keyboard events to methods in the scope.
Installation
npm install --save vi-angular-keypressor
bower install vi-angular-keypressRequire the module:
require('vi-angular-keypress');Register the module into your main app module
angular.module('myApp', ['vivify-ideas.angular-keypress']);Usage
In the template, use the vi-keypress attribute on the element to bind methods for different keypress.
<input type="text" vi-keypress="{ 13: 'enterPressed(someParam)', 27: 'escapePressed()' }">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.
