Skip to content

Commit

Permalink
Merge pull request #51 from dmitry-dedukhin/patch-1
Browse files Browse the repository at this point in the history
Use ctrl.$viewValue instead of element[0].value
  • Loading branch information
Huei Tan committed Nov 14, 2014
2 parents 8d9862a + e4a9cb7 commit a6ac140
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions dist/angular-validation.js
Original file line number Diff line number Diff line change
Expand Up @@ -495,7 +495,7 @@
* Click submit form, check the validity when submit
*/
scope.$on(ctrl.$name + 'submit-' + uid, function(event, index) {
var value = element[0].value,
var value = ctrl.$viewValue,
isValid = false;

if (index === 0) {
Expand Down Expand Up @@ -537,7 +537,7 @@
*/
if (attrs.validMethod === 'blur') {
element.bind('blur', function() {
var value = element[0].value;
var value = ctrl.$viewValue;
scope.$apply(function() {
checkValidation(scope, element, attrs, ctrl, validation, value);
});
Expand Down
2 changes: 1 addition & 1 deletion dist/angular-validation.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/directive.js
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@
* Click submit form, check the validity when submit
*/
scope.$on(ctrl.$name + 'submit-' + uid, function(event, index) {
var value = element[0].value,
var value = ctrl.$viewValue,
isValid = false;

if (index === 0) {
Expand Down Expand Up @@ -257,7 +257,7 @@
*/
if (attrs.validMethod === 'blur') {
element.bind('blur', function() {
var value = element[0].value;
var value = ctrl.$viewValue;
scope.$apply(function() {
checkValidation(scope, element, attrs, ctrl, validation, value);
});
Expand Down

0 comments on commit a6ac140

Please sign in to comment.