Skip to content

Commit 493daf7

Browse files
committed
Fixed displaying validation state on form load if the option is enabled.
1 parent 0b1ad62 commit 493daf7

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

src/directives/validation.directive.js

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -91,14 +91,6 @@ angular.module('bootstrap.angular.validation').directive('bsValidation', [
9191
displayOrHideValidationState();
9292
}
9393

94-
if (shouldValidateOnDisplay) {
95-
displayValidationState = true;
96-
ngModelController.$validate();
97-
98-
// TODO Figure out why do we require $timeout here
99-
$timeout(displayOrHideValidationState);
100-
}
101-
10294
if (shouldValidateOnBlur) {
10395
var dewatcher = $scope.$watch(function () {
10496
return ngModelController.$touched;
@@ -121,6 +113,10 @@ angular.module('bootstrap.angular.validation').directive('bsValidation', [
121113
});
122114
}
123115

116+
if (shouldValidateOnDisplay) {
117+
showValidation();
118+
}
119+
124120
// TODO Find alternative for this watch
125121
$scope.$watch(function() {
126122
return ngModelController.$viewValue + ngModelController.$modelValue;

0 commit comments

Comments
 (0)