Skip to content

Commit ec40215

Browse files
committed
Migrate PR #642 to webpack branch
1 parent a893948 commit ec40215

File tree

2 files changed

+12
-4
lines changed

2 files changed

+12
-4
lines changed

src/directives/field.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,9 @@ sfPath, sfSelect) {
197197
scope.ngModel.$setValidity(error, validity === true);
198198

199199
if (validity === true) {
200+
// Re-trigger model validator, that model itself would be re-validated
201+
scope.ngModel.$validate();
202+
200203
// Setting or removing a validity can change the field to believe its valid
201204
// but its not. So lets trigger its validation as well.
202205
scope.$broadcast('schemaFormValidate');

src/services/decorators.js

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -78,14 +78,16 @@ export default function($compileProvider, sfPathProvider) {
7878
scope.buttonClick = function($event, form) {
7979
if (angular.isFunction(form.onClick)) {
8080
form.onClick($event, form);
81-
} else if (angular.isString(form.onClick)) {
81+
}
82+
else if (angular.isString(form.onClick)) {
8283
if (sfSchema) {
8384
//evaluating in scope outside of sfSchemas isolated scope
8485
sfSchema.evalInParentScope(form.onClick, {'$event': $event, form: form});
85-
} else {
86-
scope.$eval(form.onClick, {'$event': $event, form: form});
8786
}
88-
}
87+
else{
88+
scope.$eval(form.onClick, {'$event': $event, form: form});
89+
};
90+
};
8991
};
9092

9193
/**
@@ -267,6 +269,9 @@ export default function($compileProvider, sfPathProvider) {
267269
scope.ngModel.$setValidity(error, validity === true);
268270

269271
if (validity === true) {
272+
// Re-trigger model validator, that model itself would be re-validated
273+
scope.ngModel.$validate();
274+
270275
// Setting or removing a validity can change the field to believe its valid
271276
// but its not. So lets trigger its validation as well.
272277
scope.$broadcast('schemaFormValidate');

0 commit comments

Comments
 (0)