From c2a14be8b353557c683bc20c725bf236e97415dc Mon Sep 17 00:00:00 2001 From: Edward Knowles Date: Fri, 5 Jun 2015 11:23:02 +0100 Subject: [PATCH] Fix custom validations on 1.2 --- dist/schema-form.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/dist/schema-form.js b/dist/schema-form.js index dfc86647d..91a8ae9f7 100644 --- a/dist/schema-form.js +++ b/dist/schema-form.js @@ -512,12 +512,11 @@ angular.module('schemaForm').provider('schemaFormDecorators', } if (scope.ngModel && error) { - if (scope.ngModel.$setDirty()) { - scope.ngModel.$setDirty(); - } else { - // FIXME: Check that this actually works on 1.2 + if (angular.version.major === 1 && angular.version.minor <= 2) { scope.ngModel.$dirty = true; scope.ngModel.$pristine = false; + } else if (scope.ngModel.$setDirty()) { + scope.ngModel.$setDirty(); } // Set the new validation message if one is supplied