Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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
You can’t perform that action at this time.