diff --git a/src/ng/directive/input.js b/src/ng/directive/input.js index 04af4c2a6cb9..e4352bd574ab 100644 --- a/src/ng/directive/input.js +++ b/src/ng/directive/input.js @@ -371,6 +371,10 @@ function textInputType(scope, element, attr, ctrl, $sniffer, $browser) { var listener = function() { var value = trim(element.val()); + + if(attr.trim===undefined || attr.trim==='true') { + value = trim(value); + } if (ctrl.$viewValue !== value) { scope.$apply(function() {