mirror of
https://github.com/fergalmoran/ferglie.git
synced 2026-02-18 13:46:02 +00:00
13 lines
444 B
JavaScript
Executable File
13 lines
444 B
JavaScript
Executable File
angular.module('shortioApp')
|
|
.directive('ngEnter', function () {
|
|
return function (scope, element, attrs) {
|
|
element.bind("keydown keypress", function (event) {
|
|
if (event.which === 13) {
|
|
scope.$apply(function () {
|
|
scope.$eval(attrs.ngEnter);
|
|
});
|
|
event.preventDefault();
|
|
}
|
|
});
|
|
};
|
|
}); |