Commit 74383aee2595420df48f06db648af79232451e28
Exists in
master
Merge branch 'master' into 'master'
Master(efernandez) See merge request modulos-npm/foca-directivas!4
Showing
2 changed files
Show diff stats
package.json
| 1 | { | 1 | { |
| 2 | "name": "foca-directivas", | 2 | "name": "foca-directivas", |
| 3 | "version": "0.0.1", | 3 | "version": "0.0.1", |
| 4 | "description": "Directivas para usarse en los productos Debo Suite", | 4 | "description": "Directivas para usarse en los productos Debo Suite", |
| 5 | "main": "index.js", | 5 | "main": "index.js", |
| 6 | "scripts": { | 6 | "scripts": { |
| 7 | "test": "echo \"Error: no test specified\" && exit 1", | 7 | "test": "echo \"Error: no test specified\" && exit 1", |
| 8 | "compile": "gulp uglify", | 8 | "compile": "gulp uglify", |
| 9 | "postinstall": "npm run compile && gulp clean-post-install" | 9 | "postinstall": "npm run compile && gulp clean-post-install" |
| 10 | }, | 10 | }, |
| 11 | "pre-commit": [ | 11 | "pre-commit": [ |
| 12 | "gulp-pre-commit" | 12 | "gulp-pre-commit" |
| 13 | ], | 13 | ], |
| 14 | "repository": { | 14 | "repository": { |
| 15 | "type": "git", | 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 | "author": "Nicolás Guarnieri", | 18 | "author": "Nicolás Guarnieri", |
| 19 | "license": "ISC", | 19 | "license": "ISC", |
| 20 | "peerDependencies": { | 20 | "peerDependencies": { |
| 21 | "angular": "^1.7.4", | 21 | "angular": "^1.7.4", |
| 22 | "gulp": "^3.9.1", | 22 | "gulp": "^3.9.1", |
| 23 | "gulp-concat": "^2.6.1", | 23 | "gulp-concat": "^2.6.1", |
| 24 | "gulp-jshint": "^2.1.0", | 24 | "gulp-jshint": "^2.1.0", |
| 25 | "gulp-rename": "^1.4.0", | 25 | "gulp-rename": "^1.4.0", |
| 26 | "gulp-replace": "^1.0.0", | 26 | "gulp-replace": "^1.0.0", |
| 27 | "gulp-uglify": "^3.0.1", | 27 | "gulp-uglify": "^3.0.1", |
| 28 | "jquery": "^3.3.1", | 28 | "jquery": "^3.3.1", |
| 29 | "jshint": "^2.9.6", | 29 | "jshint": "^2.9.6", |
| 30 | "pump": "^3.0.0" | 30 | "pump": "^3.0.0" |
| 31 | }, | 31 | }, |
| 32 | "devDependencies": { | 32 | "devDependencies": { |
| 33 | "angular": "^1.7.4", | 33 | "angular": "^1.7.4", |
| 34 | "gulp": "^3.9.1", | 34 | "gulp": "^3.9.1", |
| 35 | "gulp-clean": "^0.4.0", | 35 | "gulp-clean": "^0.4.0", |
| 36 | "gulp-concat": "^2.6.1", | 36 | "gulp-concat": "^2.6.1", |
| 37 | "gulp-jshint": "^2.1.0", | 37 | "gulp-jshint": "^2.1.0", |
| 38 | "gulp-rename": "^1.4.0", | 38 | "gulp-rename": "^1.4.0", |
| 39 | "gulp-replace": "^1.0.0", | 39 | "gulp-replace": "^1.0.0", |
| 40 | "gulp-uglify": "^3.0.1", | 40 | "gulp-uglify": "^3.0.1", |
| 41 | "jquery": "^3.3.1", | 41 | "jquery": "^3.3.1", |
| 42 | "jshint": "^2.9.6", | 42 | "jshint": "^2.9.6", |
| 43 | "pump": "^3.0.0" | 43 | "pump": "^3.0.0" |
| 44 | } | 44 | } |
| 45 | } | 45 | } |
| 46 | 46 |
src/js/escKey-directive.js
| File was created | 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 | }); | ||
| 14 |