From dc29c3ae43550ff096723f0fa748a6c652dfb16b Mon Sep 17 00:00:00 2001 From: freewind Date: Tue, 12 Jun 2012 14:29:15 +0800 Subject: [PATCH] control trimming of content --- src/ng/directive/input.js | 4 ++++ 1 file changed, 4 insertions(+) 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() {