Commit c9baa0e8ef63174647c7f648001b8f00de580119

Authored by Eric Fernandez
Exists in master

Merge branch 'master' into 'master'

Master

See merge request modulos-npm/foca-directivas!8
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 "install-dev": "npm install -D angular gulp gulp-clean gulp-concat gulp-jshint gulp-rename gulp-replace gulp-uglify jquery jshint pump"
10 }, 11 },
11 "pre-commit": [ 12 "pre-commit": [
12 "gulp-pre-commit" 13 "gulp-pre-commit"
13 ], 14 ],
14 "repository": { 15 "repository": {
15 "type": "git", 16 "type": "git",
16 "url": "https://debo.suite.repo/modulos-npm/foca-directivas.git" 17 "url": "https://debo.suite.repo/modulos-npm/foca-directivas.git"
17 }, 18 },
18 "author": "Nicolás Guarnieri", 19 "author": "Nicolás Guarnieri",
19 "license": "ISC", 20 "license": "ISC",
20 "peerDependencies": { 21 "peerDependencies": {
21 "angular": "^1.7.4", 22 "angular": "^1.7.4",
22 "gulp": "^3.9.1", 23 "gulp": "^3.9.1",
23 "gulp-concat": "^2.6.1", 24 "gulp-concat": "^2.6.1",
24 "gulp-jshint": "^2.1.0", 25 "gulp-jshint": "^2.1.0",
25 "gulp-rename": "^1.4.0", 26 "gulp-rename": "^1.4.0",
26 "gulp-replace": "^1.0.0", 27 "gulp-replace": "^1.0.0",
27 "gulp-uglify": "^3.0.1", 28 "gulp-uglify": "^3.0.1",
28 "jquery": "^3.3.1", 29 "jquery": "^3.3.1",
29 "jshint": "^2.9.6", 30 "jshint": "^2.9.6",
30 "pump": "^3.0.0" 31 "pump": "^3.0.0"
31 }, 32 },
32 "devDependencies": { 33 "devDependencies": {
33 "angular": "^1.7.4", 34 "angular": "^1.7.5",
34 "gulp": "^3.9.1", 35 "gulp": "^3.9.1",
35 "gulp-clean": "^0.4.0", 36 "gulp-clean": "^0.4.0",
36 "gulp-concat": "^2.6.1", 37 "gulp-concat": "^2.6.1",
37 "gulp-jshint": "^2.1.0", 38 "gulp-jshint": "^2.1.0",
38 "gulp-rename": "^1.4.0", 39 "gulp-rename": "^1.4.0",
39 "gulp-replace": "^1.0.0", 40 "gulp-replace": "^1.0.0",
40 "gulp-uglify": "^3.0.1", 41 "gulp-uglify": "^3.0.1",
41 "jquery": "^3.3.1", 42 "jquery": "^3.3.1",
42 "jshint": "^2.9.6", 43 "jshint": "^2.9.6",
43 "pump": "^3.0.0" 44 "pump": "^3.0.0"
44 } 45 }
45 } 46 }
46 47
src/js/focaTipo-directive.js
File was created 1 angular.module('focaDirectivas')
2 .directive('focaTipoInput',['$rootScope', function($rootScope) {
3 var mostrarTeclado;
4 return {
5 link: function(scope, element, attr, ctrls) {
6 if(mostrarTeclado) {
7 element[0].type = 'text';
8 return;
9 }
10 element[0].type = 'number';
11 $rootScope.$on('usarTeclado', function(event, data) {
12 if(data) {
13 mostrarTeclado = true;
14 element[0].type = 'text';
15 return;
16 }
17 mostrarTeclado = false;
18 element[0].type = 'number';
19 });
20 }
21 }
22 }]);
23