From 90832a6bca7c3b9908e02aa425f1c5eea798c7f6 Mon Sep 17 00:00:00 2001 From: Mohamed Qamhieh Date: Tue, 24 Mar 2015 12:13:05 +0200 Subject: [PATCH] Fix sending tv4 standard message with broadcasted backend validation errors. --- src/services/decorators.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/services/decorators.js b/src/services/decorators.js index 324f284c1..bd012b12f 100644 --- a/src/services/decorators.js +++ b/src/services/decorators.js @@ -250,9 +250,11 @@ angular.module('schemaForm').provider('schemaFormDecorators', scope.ngModel.$setValidity(error, validity === true); - // Setting or removing a validity can change the field to believe its valid - // but its not. So lets trigger its validation as well. - scope.$broadcast('schemaFormValidate'); + if (validity === true) { + // Setting or removing a validity can change the field to believe its valid + // but its not. So lets trigger its validation as well. + scope.$broadcast('schemaFormValidate'); + } } }) }