diff options
| author | Misko Hevery | 2010-02-04 13:27:56 -0800 |
|---|---|---|
| committer | Misko Hevery | 2010-02-04 13:27:56 -0800 |
| commit | 1da18e73a4d09b2a1ace92a4094eeba014eb7dc4 (patch) | |
| tree | 5f679ca5b575f29cd5938099a5dab37aa968c85f /src/Widgets.js | |
| parent | 5dd43b85e73ca1708e7fd85094b533b02266a79a (diff) | |
| download | angular.js-1da18e73a4d09b2a1ace92a4094eeba014eb7dc4.tar.bz2 | |
consider widget errors only when widgets are visible
Diffstat (limited to 'src/Widgets.js')
| -rw-r--r-- | src/Widgets.js | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/Widgets.js b/src/Widgets.js index c5ab7c6f..01877128 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 && $.trim(value).length > 0); + isValidationError = !(value && $.trim("" + value).length > 0); } var errorText = isValidationError ? "Required Value" : null; if (!isValidationError && this.validator && value) { @@ -239,7 +239,7 @@ TextController.prototype = { } if (this.lastErrorText !== errorText) { this.lastErrorText = isValidationError; - if (errorText !== null) { + if (errorText !== null && isVisible(view)) { view.setAttribute('ng-error', errorText); scope.markInvalid(this); } |
