mirror of
https://github.com/fergalmoran/dss.web.git
synced 2026-02-16 04:55:11 +00:00
13 lines
449 B
JavaScript
13 lines
449 B
JavaScript
angular.module('dssWebApp')
|
|
.directive('enterPress', function () {
|
|
return function (scope, element, attrs) {
|
|
element.bind("keydown keypress", function (event) {
|
|
if (event.which === 13) {
|
|
scope.$apply(function () {
|
|
scope.$eval(attrs.enterPress);
|
|
});
|
|
event.preventDefault();
|
|
}
|
|
});
|
|
};
|
|
}); |