@@ -1709,7 +1709,7 @@ var NgModelController = ['$scope', '$exceptionHandler', '$attrs', '$element', '$
1709
1709
$animate . removeClass ( $element , PENDING_CLASS ) ;
1710
1710
} ;
1711
1711
1712
- this . $$setPending = function ( validationErrorKey , promise , currentValue ) {
1712
+ this . $$setPending = function ( validationErrorKey , promise , modelValue , viewValue ) {
1713
1713
ctrl . $pending = ctrl . $pending || { } ;
1714
1714
if ( angular . isUndefined ( ctrl . $pending [ validationErrorKey ] ) ) {
1715
1715
ctrl . $pending [ validationErrorKey ] = true ;
@@ -1725,19 +1725,19 @@ var NgModelController = ['$scope', '$exceptionHandler', '$attrs', '$element', '$
1725
1725
1726
1726
//Special-case for (undefined|null|false|NaN) values to avoid
1727
1727
//having to compare each of them with each other
1728
- currentValue = currentValue || '' ;
1728
+ viewValue = viewValue || '' ;
1729
1729
promise . then ( resolve ( true ) , resolve ( false ) ) ;
1730
1730
1731
1731
function resolve ( bool ) {
1732
1732
return function ( ) {
1733
1733
var value = ctrl . $viewValue || '' ;
1734
- if ( ctrl . $pending && ctrl . $pending [ validationErrorKey ] && currentValue === value ) {
1734
+ if ( ctrl . $pending && ctrl . $pending [ validationErrorKey ] && viewValue === value ) {
1735
1735
pendingCount -- ;
1736
1736
delete ctrl . $pending [ validationErrorKey ] ;
1737
1737
ctrl . $setValidity ( validationErrorKey , bool ) ;
1738
1738
if ( pendingCount === 0 ) {
1739
1739
ctrl . $$clearPending ( ) ;
1740
- ctrl . $$updateValidModelValue ( value ) ;
1740
+ ctrl . $$updateValidModelValue ( modelValue ) ;
1741
1741
ctrl . $$writeModelToScope ( ) ;
1742
1742
}
1743
1743
}
@@ -1947,7 +1947,7 @@ var NgModelController = ['$scope', '$exceptionHandler', '$attrs', '$element', '$
1947
1947
throw $ngModelMinErr ( "$asyncValidators" ,
1948
1948
"Expected asynchronous validator to return a promise but got '{0}' instead." , result ) ;
1949
1949
}
1950
- ctrl . $$setPending ( validator , result , modelValue ) ;
1950
+ ctrl . $$setPending ( validator , result , modelValue , viewValue ) ;
1951
1951
} ) ;
1952
1952
}
1953
1953
0 commit comments