Commit 74383aee2595420df48f06db648af79232451e28

Authored by Eric Fernandez
Exists in master

Merge branch 'master' into 'master'

Master(efernandez)

See merge request modulos-npm/foca-directivas!4
... ... @@ -13,7 +13,7 @@
13 13 ],
14 14 "repository": {
15 15 "type": "git",
16   - "url": "https://192.168.0.11/modulos-npm/foca-directivas.git"
  16 + "url": "https://debo.suite.repo/modulos-npm/foca-directivas.git"
17 17 },
18 18 "author": "Nicolás Guarnieri",
19 19 "license": "ISC",
src/js/escKey-directive.js
... ... @@ -0,0 +1,13 @@
  1 +angular.module('focaDirectivas')
  2 + .directive('escKey', function() {
  3 + return function(scope, element, attrs) {
  4 + element.bind('keydown keypress', function(event) {
  5 + if(event.which === 27) { // 27 = esc key
  6 + scope.$apply(function (){
  7 + scope.$eval(attrs.escKey);
  8 + });
  9 + event.preventDefault();
  10 + }
  11 + });
  12 + };
  13 + });