Skip to content

Commit b2a8a08

Browse files
committed
make validator more leniant for errors which are false instead of null
1 parent 9d566fe commit b2a8a08

File tree

4 files changed

+4
-4
lines changed

4 files changed

+4
-4
lines changed

angular-minified.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

angular.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3490,7 +3490,7 @@ TextController.prototype = {
34903490
}
34913491
if (this.lastErrorText !== errorText) {
34923492
this.lastErrorText = isValidationError;
3493-
if (errorText !== null && isVisible(view)) {
3493+
if (errorText && isVisible(view)) {
34943494
view.setAttribute('ng-error', errorText);
34953495
scope.markInvalid(this);
34963496
}

src/Widgets.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,7 @@ TextController.prototype = {
239239
}
240240
if (this.lastErrorText !== errorText) {
241241
this.lastErrorText = isValidationError;
242-
if (errorText !== null && isVisible(view)) {
242+
if (errorText && isVisible(view)) {
243243
view.setAttribute('ng-error', errorText);
244244
scope.markInvalid(this);
245245
}

test/WidgetsTest.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ WidgetTest.prototype.testValidator = function () {
1818
var scope = new Scope({$invalidWidgets:[]});
1919
var cntl = new TextController(view[0], 'a', angularFormatter.noop);
2020
angular.validator.testValidator = function(value, expect){
21-
return value == expect ? null : "Error text";
21+
return value == expect ? false : "Error text";
2222
};
2323

2424
scope.set('a', '');

0 commit comments

Comments
 (0)