aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMisko Hevery2010-02-04 11:45:38 -0800
committerMisko Hevery2010-02-04 11:45:38 -0800
commit5dd43b85e73ca1708e7fd85094b533b02266a79a (patch)
treeb302e7351307fc2927d750e469e6afeb8d5343c4 /src
parent302472f4fa50f995085ebf36b8990bedf3806973 (diff)
downloadangular.js-5dd43b85e73ca1708e7fd85094b533b02266a79a.tar.bz2
ng-required treats whitespace as empty
Diffstat (limited to 'src')
-rw-r--r--src/Widgets.js2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/Widgets.js b/src/Widgets.js
index 69b444c0..c5ab7c6f 100644
--- a/src/Widgets.js
+++ b/src/Widgets.js
@@ -230,7 +230,7 @@ TextController.prototype = {
var isValidationError = false;
view.removeAttribute('ng-error');
if (this.required) {
- isValidationError = !(value && value.length > 0);
+ isValidationError = !(value && $.trim(value).length > 0);
}
var errorText = isValidationError ? "Required Value" : null;
if (!isValidationError && this.validator && value) {