Skip to content

Instantly share code, notes, and snippets.

Created September 10, 2013 01:07
What would you like to do?
angular.js keyevents for everywhere
.directive('onKeydown', ['$parse',function($parse) {
return function(scope, elm, attrs) {
var keydownFn = $parse(attrs.onKeydown);
elm.bind("keydown", function(event) {
keydownFn(scope, { '$event': event });
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment