Skip to content

Commit 151c242

Browse files
committed
Merge branch 'michal-lipski-master'
2 parents 1dc17d9 + 9b44bc5 commit 151c242

File tree

3 files changed

+8
-3
lines changed

3 files changed

+8
-3
lines changed

dist/angular-validator.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@
5252
return increaseSuccessCount();
5353
},
5454
error: function() {
55+
var base, base1;
5556
if (rule.enableError && ++errorCount === 1) {
5657
ctrl.$setValidity(attrs.ngModel, false);
5758
rule.error(model(scope), scope, element, attrs, $injector);
@@ -61,9 +62,9 @@
6162
element[0].scrollIntoViewIfNeeded();
6263
} catch (undefined) {}
6364
if (element[0].select) {
64-
return element[0].select();
65+
return typeof (base = element[0]).select === "function" ? base.select() : void 0;
6566
} else {
66-
return element[0].focus();
67+
return typeof (base1 = element[0]).focus === "function" ? base1.focus() : void 0;
6768
}
6869
}
6970
}
@@ -220,6 +221,9 @@
220221
dotIndex = attrs.ngModel.indexOf('.');
221222
itemExpression = dotIndex >= 0 ? attrs.ngModel.substr(0, dotIndex) : attrs.ngModel;
222223
itemModel = $parse(itemExpression)(scope);
224+
if (itemModel == null) {
225+
return false;
226+
}
223227
return anyHashKey($parse(modelName)(broadcast.targetScope), itemModel.$$hashKey);
224228
}
225229
}

dist/angular-validator.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/directive.coffee

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,7 @@ angular.module 'validator.directive', ['validator.provider']
176176
dotIndex = attrs.ngModel.indexOf '.'
177177
itemExpression = if dotIndex >= 0 then attrs.ngModel.substr(0, dotIndex) else attrs.ngModel
178178
itemModel = $parse(itemExpression) scope
179+
return no if not itemModel?
179180
return anyHashKey $parse(modelName)(broadcast.targetScope), itemModel.$$hashKey
180181
yes
181182
scope.$on $validator.broadcastChannel.prepare, (self, object) ->

0 commit comments

Comments
 (0)