Skip to content

Commit 19a2c1b

Browse files
author
tsowerby
committed
Build
1 parent 4b17cbf commit 19a2c1b

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

dist/schema-form.js

+10-2
Original file line numberDiff line numberDiff line change
@@ -2817,7 +2817,13 @@ angular.module('schemaForm').directive('schemaValidate', ['sfValidator', '$parse
28172817
var schema = form.schema;
28182818

28192819
// A bit ugly but useful.
2820-
scope.validateField = function() {
2820+
scope.validateField = function(formName) {
2821+
2822+
// If we have specified a form name, and this model is not within
2823+
// that form, then leave things be.
2824+
if(formName != undefined && ngModel.$$parentForm.$name !== formName) {
2825+
return;
2826+
}
28212827

28222828
// Special case: arrays
28232829
// TODO: Can this be generalized in a way that works consistently?
@@ -2864,7 +2870,9 @@ angular.module('schemaForm').directive('schemaValidate', ['sfValidator', '$parse
28642870
});
28652871

28662872
// Listen to an event so we can validate the input on request
2867-
scope.$on('schemaFormValidate', scope.validateField);
2873+
scope.$on('schemaFormValidate', function(event, formName) {
2874+
scope.validateField(formName);
2875+
});
28682876

28692877
scope.schemaError = function() {
28702878
return error;

0 commit comments

Comments
 (0)