From 50516545a64bc145f0367237c98f8f7af29a82a6 Mon Sep 17 00:00:00 2001 From: Luigi Date: Thu, 11 Apr 2019 12:59:36 -0300 Subject: [PATCH] Quitar autocomplete de los inputs --- src/js/uppercaseOnly-directive.js | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/js/uppercaseOnly-directive.js b/src/js/uppercaseOnly-directive.js index 4cab819..cf4ce52 100644 --- a/src/js/uppercaseOnly-directive.js +++ b/src/js/uppercaseOnly-directive.js @@ -4,17 +4,18 @@ angular.module('focaDirectivas') return { require: '?ngModel', link: function(scope, element, attrs, modelCtrl) { - if(attrs.type === 'text' && - !attrs.readonly && - !attrs.disabled && - !attrs.uibDatepickerPopup) { - + if (attrs.type === 'text' && + !attrs.readonly && + !attrs.disabled && + !attrs.uibDatepickerPopup) { + modelCtrl.$parsers.push(function(input) { return input ? input.toUpperCase() : ''; }); } - + element.addClass('text-uppercase'); + element[0].autocomplete = 'off'; } }; } -- 1.9.1