angular
.module('app.directives')
.directive('enterKeyInput', enterKeyInput);
enterKeyInput.$inject = [];
/* @ngInject */
function enterKeyInput() {
return {
restrict: 'AC',
link: function (scope, element, attrs) {
element.bind('keyup', function (e) {
if ([13].indexOf(e.which) !== -1) {
e.preventDefault();
e.stopPropagation();
element.click();
}
});
}
};
}