aboutsummaryrefslogtreecommitdiffstats
path: root/src/ng/directive/input.js
diff options
context:
space:
mode:
authorDaniel Tabuenca2013-12-04 16:25:49 -0800
committerIgor Minar2013-12-04 22:49:11 -0800
commitb6d5439343b9801f7f2a009d0de09cba9aa21a1d (patch)
tree88f8783a6ba367120aee73f9165e82d683ef2d19 /src/ng/directive/input.js
parent93901bdde4bb9f0ba114ebb33b8885808e1823e1 (diff)
downloadangular.js-b6d5439343b9801f7f2a009d0de09cba9aa21a1d.tar.bz2
fix(input): ensure ngModelWatch() triggers second digest pass when appropriate
Due to an earlier change, ngModelWatch() no longer returns a value to the caller. This means the digest loop has no way to tell if the watch actually modified anything and so can not schedule another pass. This means any watches that watch form or model controller changes (e.g. watches on form.$valid) that are scheduled prior to an ngModelWatch() will not be able to see any changes made therin. This commit fixes this behavior by returning the latest evaluated ng-model value. Closes #5258 Closes #5282
Diffstat (limited to 'src/ng/directive/input.js')
-rw-r--r--src/ng/directive/input.js4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/ng/directive/input.js b/src/ng/directive/input.js
index 1d8d14ee..9ff50364 100644
--- a/src/ng/directive/input.js
+++ b/src/ng/directive/input.js
@@ -1097,7 +1097,7 @@ var NgModelController = ['$scope', '$exceptionHandler', '$attrs', '$element', '$
* It will update the $viewValue, then pass this value through each of the functions in `$parsers`,
* which includes any validators. The value that comes out of this `$parsers` pipeline, be applied to
* `$modelValue` and the **expression** specified in the `ng-model` attribute.
- *
+ *
* Lastly, all the registered change listeners, in the `$viewChangeListeners` list, are called.
*
* Note that calling this function does not trigger a `$digest`.
@@ -1154,6 +1154,8 @@ var NgModelController = ['$scope', '$exceptionHandler', '$attrs', '$element', '$
ctrl.$render();
}
}
+
+ return value;
});
}];