Skip to content
This repository was archived by the owner on Jul 1, 2020. It is now read-only.

Commit 96bc98f

Browse files
committed
Fix issue where empty Form Controller was throwing an error
1 parent 6d99a53 commit 96bc98f

File tree

6 files changed

+11
-8
lines changed

6 files changed

+11
-8
lines changed

bower.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "angular-validation-ghiscoding",
3-
"version": "1.5.15",
3+
"version": "1.5.16",
44
"author": "Ghislain B.",
55
"description": "Angular-Validation Directive and Service (ghiscoding)",
66
"main": [

dist/angular-validation.min.js

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

gulpfile.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ gulp.task('compress', ['clean'], function() {
102102
.pipe(gulp.dest('dist'));
103103
});
104104

105-
gulp.task('test', function() {
105+
gulp.task('e2e', function() {
106106
gulp.src(["./protractor/*_spec.js"])
107107
.pipe(protractor({
108108
configFile: "protractor/conf.js",

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "angular-validation-ghiscoding",
3-
"version": "1.5.15",
3+
"version": "1.5.16",
44
"author": "Ghislain B.",
55
"description": "Angular-Validation Directive and Service (ghiscoding)",
66
"main": "dist/angular-validation.min",

readme.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#Angular Validation (Directive / Service)
2-
`Version: 1.5.15`
2+
`Version: 1.5.16`
33
### Forms Validation with Angular made easy!
44
##### (Concept comes from the amazing Laravel)
55

src/validation-common.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,10 @@ angular
153153
// also save it inside controllerAs form (if found)
154154
if (!!form && !!form.$name) {
155155
var formName = form.$name.indexOf('.') >= 0 ? form.$name.split('.')[1] : form.$name;
156-
var ctrlForm = (!!_globalOptions.controllerAs[formName]) ? _globalOptions.controllerAs[formName] : self.elm.controller()[formName];
156+
var ctrlForm = (!!_globalOptions.controllerAs && !!_globalOptions.controllerAs[formName])
157+
? _globalOptions.controllerAs[formName]
158+
: ((typeof self.elm.controller() !== "undefined") ? self.elm.controller()[formName] : null);
159+
157160
if(!!ctrlForm) {
158161
ctrlForm.$validationSummary = arrayFindObjects(_validationSummary, 'formName', form.$name);
159162
}

0 commit comments

Comments
 (0)