Skip to content

Commit

Permalink
Merge pull request #43 from dlear/master
Browse files Browse the repository at this point in the history
Fix for issue  Missing "var" declaration #39
  • Loading branch information
Jakobovski committed Jun 28, 2015
2 parents 0446519 + 0823972 commit 07823d5
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions dist/angular-validator.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ angular.module('angularValidator').directive('angularValidator',
}
else {
// Determine if the element in question is to be updated on blur
isDirtyElement = "validate-on" in elementToWatch.attributes && elementToWatch.attributes["validate-on"].value === "dirty";
var isDirtyElement = "validate-on" in elementToWatch.attributes && elementToWatch.attributes["validate-on"].value === "dirty";

if (isDirtyElement){
updateValidationMessage(elementToWatch);
Expand Down Expand Up @@ -173,7 +173,7 @@ angular.module('angularValidator').directive('angularValidator',


// Only add validation messages if the form field is $dirty or the form has been submitted
if (scopeElementModel.$dirty || scope[element.form.name] && scope[element.form.name].submitted) {
if (scopeElementModel.$dirty || scope[element.form.name].submitted) {

if (scopeElementModel.$error.required) {
// If there is a custom required message display it
Expand Down Expand Up @@ -232,7 +232,7 @@ angular.module('angularValidator').directive('angularValidator',


// Only add/remove validation classes if the field is $dirty or the form has been submitted
if (formField.$dirty || scope[element.form.name] && scope[element.form.name].submitted) {
if (formField.$dirty || scope[element.form.name].submitted) {
if (formField.$invalid) {
angular.element(element.parentNode).addClass('has-error');

Expand Down
2 changes: 1 addition & 1 deletion dist/angular-validator.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions src/angular-validator.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ angular.module('angularValidator').directive('angularValidator',
}
else {
// Determine if the element in question is to be updated on blur
isDirtyElement = "validate-on" in elementToWatch.attributes && elementToWatch.attributes["validate-on"].value === "dirty";
var isDirtyElement = "validate-on" in elementToWatch.attributes && elementToWatch.attributes["validate-on"].value === "dirty";

if (isDirtyElement){
updateValidationMessage(elementToWatch);
Expand Down Expand Up @@ -246,4 +246,4 @@ angular.module('angularValidator').directive('angularValidator',
}
};
}
);
);

0 comments on commit 07823d5

Please sign in to comment.