Skip to content

Instantly share code, notes, and snippets.

@stevermeister
Created January 31, 2014 14:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save stevermeister/8733357 to your computer and use it in GitHub Desktop.
Save stevermeister/8733357 to your computer and use it in GitHub Desktop.
app.directive('ngEnter', function() {
return function(scope, elm, attrs) {
elm.bind('keypress', function(event) {
var modifier = event.ctrlKey || event.metaKey;
if (modifier && event.charCode === 13) scope.$apply(attrs.ngEnter);
});
};
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment