@@ -547,7 +547,7 @@ var NgModelController = ['$scope', '$exceptionHandler', '$attrs', '$element', '$
547
547
ctrl . $modelValue = allValid ? modelValue : undefined ;
548
548
549
549
if ( ctrl . $modelValue !== prevModelValue ) {
550
- ctrl . $$writeModelToScope ( ) ;
550
+ ctrl . $$writeModelToScope ( ctrl . $modelValue , prevModelValue ) ;
551
551
}
552
552
}
553
553
} ) ;
@@ -719,16 +719,16 @@ var NgModelController = ['$scope', '$exceptionHandler', '$attrs', '$element', '$
719
719
720
720
function writeToModelIfNeeded ( ) {
721
721
if ( ctrl . $modelValue !== prevModelValue ) {
722
- ctrl . $$writeModelToScope ( ) ;
722
+ ctrl . $$writeModelToScope ( ctrl . $modelValue , prevModelValue ) ;
723
723
}
724
724
}
725
725
} ;
726
726
727
- this . $$writeModelToScope = function ( ) {
727
+ this . $$writeModelToScope = function ( currentModelValue , previousModelValue ) {
728
728
ngModelSet ( $scope , ctrl . $modelValue ) ;
729
729
forEach ( ctrl . $viewChangeListeners , function ( listener ) {
730
730
try {
731
- listener ( ) ;
731
+ listener ( currentModelValue , previousModelValue ) ;
732
732
} catch ( e ) {
733
733
$exceptionHandler ( e ) ;
734
734
}
@@ -751,7 +751,8 @@ var NgModelController = ['$scope', '$exceptionHandler', '$attrs', '$element', '$
751
751
* and `$validators` pipelines. If there are no special {@link ngModelOptions} specified then the staged
752
752
* value sent directly for processing, finally to be applied to `$modelValue` and then the
753
753
* **expression** specified in the `ng-model` attribute. Lastly, all the registered change listeners,
754
- * in the `$viewChangeListeners` list, are called.
754
+ * in the `$viewChangeListeners` list, are called. The parameters for the $viewChangeListeners are
755
+ * the current and the previous value.
755
756
*
756
757
* In case the {@link ng.directive:ngModelOptions ngModelOptions} directive is used with `updateOn`
757
758
* and the `default` trigger is not listed, all those actions will remain pending until one of the
0 commit comments