Permalink
Browse files

Obey pristine success option

  • Loading branch information...
1 parent 1a18972 commit d6d1dd62c8a429932336fc3ffee1d41671a4b46b @edclements edclements committed Sep 23, 2016
Showing with 8 additions and 2 deletions.
  1. +8 −2 src/services/decorators.js
@@ -138,8 +138,14 @@ angular.module('schemaForm').provider('schemaFormDecorators',
if (!scope.ngModel) {
return false;
}
- return scope.ngModel.$valid &&
- (!scope.ngModel.$pristine || !scope.ngModel.$isEmpty(scope.ngModel.$modelValue));
+ if (scope.options && scope.options.pristine &&
+ scope.options.pristine.success === false) {
+ return scope.ngModel.$valid &&
+ (!scope.ngModel.$pristine && !scope.ngModel.$isEmpty(scope.ngModel.$modelValue));
+ } else {
+ return scope.ngModel.$valid &&
+ (!scope.ngModel.$pristine || !scope.ngModel.$isEmpty(scope.ngModel.$modelValue));
+ }
};
scope.hasError = function() {

0 comments on commit d6d1dd6

Please sign in to comment.