From 67b50ed567b993c17ed2f9e50c92dccf34ea2e7f Mon Sep 17 00:00:00 2001 From: Duncan Lock Date: Wed, 20 May 2015 18:41:05 -0700 Subject: [PATCH 1/3] Updated demo index.html to source everything from bower_components Was previously getting components from a mixture of locations - CDNs, github and the local bower_components - despite everything being available locally in bower_components. I updated it to source everything from the local bower_components folder This is more consistent and ensures that the demo is using the correct versions of all components, rather than a mixture. --- index.html | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/index.html b/index.html index 398a5cb..4253528 100644 --- a/index.html +++ b/index.html @@ -4,7 +4,7 @@ angular-form-builder - + @@ -12,13 +12,13 @@ - - - + + + - - + + From 6c531bd4ab8a8714e0140b16326d0756180686c0 Mon Sep 17 00:00:00 2001 From: Duncan Lock Date: Wed, 20 May 2015 20:57:52 -0700 Subject: [PATCH 2/3] Revert index.html to upstream version. --- index.html | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/index.html b/index.html index 4253528..398a5cb 100644 --- a/index.html +++ b/index.html @@ -4,7 +4,7 @@ angular-form-builder - + @@ -12,13 +12,13 @@ - - - + + + - - + + From 9fab4615dd698bfa259bbb6e7026707145f1e983 Mon Sep 17 00:00:00 2001 From: Duncan Lock Date: Tue, 2 Jun 2015 19:59:24 -0700 Subject: [PATCH 3/3] Fixed a possible 'Cannot read property 'length' of undefined' when validating an empty text input. --- dist/angular-form-builder.js | 4 +++- src/module.coffee | 3 ++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/dist/angular-form-builder.js b/dist/angular-form-builder.js index 55f3c77..b3739c6 100644 --- a/dist/angular-form-builder.js +++ b/dist/angular-form-builder.js @@ -1303,7 +1303,9 @@ $validator.register('text', { invoke: 'watch', validator: function(value, scope, element, attrs, $injector) { - return scope.minLength === 0 || (value.length >= scope.minLength && value.length <= scope.maxLength); + var val; + val = value || ''; + return scope.minLength === 0 || (val.length >= scope.minLength && val.length <= scope.maxLength); } }); return $validator.register('numberRange', { diff --git a/src/module.coffee b/src/module.coffee index e7ca87b..41a4660 100644 --- a/src/module.coffee +++ b/src/module.coffee @@ -3,7 +3,8 @@ angular.module 'builder', ['builder.directive'] $validator.register('text', { invoke: 'watch' validator: (value, scope, element, attrs, $injector) -> - scope.minLength is 0 || (value.length >= scope.minLength && value.length <= scope.maxLength) + val = value || '' + scope.minLength is 0 || (val.length >= scope.minLength && val.length <= scope.maxLength) }) $validator.register('numberRange', { invoke: 'watch'