blob: 1f8b97713218c4606b9355eef4783a1b2c3b8e7a [file] [log] [blame]
module.exports = function ngEnterDirective() {
return function(scope, element, attrs) {
element.bind('keydown keypress', function(event) {
if (event.which === 13) {
scope.$apply(function() {
scope.$eval(attrs.ngEnter, {event: event})
})
event.preventDefault()
}
})
}
}