From 6b76528c62535be34dbe9c059d90f9d7c15d0537 Mon Sep 17 00:00:00 2001 From: Mathias Geat Date: Mon, 23 Mar 2015 09:19:27 +0100 Subject: [PATCH] add global form option to disable tv4 validation --- src/directives/schema-validate.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/directives/schema-validate.js b/src/directives/schema-validate.js index eabe24ac1..cfa335260 100644 --- a/src/directives/schema-validate.js +++ b/src/directives/schema-validate.js @@ -41,6 +41,11 @@ angular.module('schemaForm').directive('schemaValidate', ['sfValidator', 'sfSele return viewValue; } + // Omit TV4 validation + if (scope.options && scope.options.tv4Validation === false) { + return viewValue; + } + var result = sfValidator.validate(form, viewValue); // Since we might have different tv4 errors we must clear all // errors that start with tv4-