ieat-ui.js 488 B

123456789101112131415
  1. (function() {
  2. try {return angular.module('ieat.ui')}
  3. catch {return angular.module('ieat.ui', [])}}
  4. )().directive('myOnEnter', function () {
  5. return function (scope, element, attrs) {
  6. element.bind("keydown keypress", function (event) {
  7. if(event.which === 13) {
  8. scope.$apply(function (){
  9. scope.$eval(attrs.myOnEnter);
  10. });
  11. event.preventDefault();
  12. }
  13. });
  14. };
  15. });