From 0b29645f41e0c7223361f3d18026383178d26da8 Mon Sep 17 00:00:00 2001 From: Tim Whitbeck Date: Thu, 13 Feb 2014 12:16:01 -0500 Subject: [PATCH] fix(input): apply directives to only suitable inputs --- src/ng/directive/input.js | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/src/ng/directive/input.js b/src/ng/directive/input.js index 85d0f22ddc85..c9f924371d8d 100644 --- a/src/ng/directive/input.js +++ b/src/ng/directive/input.js @@ -90,6 +90,7 @@ var inputType = { */ 'text': textInputType, + 'textarea': textInputType, /** @@ -419,12 +420,7 @@ var inputType = { */ - 'checkbox': checkboxInputType, - - 'hidden': noop, - 'button': noop, - 'submit': noop, - 'reset': noop + 'checkbox': checkboxInputType }; // A helper function to call $setValidity and return the value / undefined, @@ -830,8 +826,11 @@ var inputDirective = ['$browser', '$sniffer', function($browser, $sniffer) { require: '?ngModel', link: function(scope, element, attr, ctrl) { if (ctrl) { - (inputType[lowercase(attr.type)] || inputType.text)(scope, element, attr, ctrl, $sniffer, - $browser); + var type = element.prop('type'); + + if (inputType[type]) { + inputType[type](scope, element, attr, ctrl, $sniffer, $browser); + } } } };