aboutsummaryrefslogtreecommitdiffstats
path: root/src/ng/directive/input.js
diff options
context:
space:
mode:
authorMathis Hofer2013-11-12 11:23:36 +0100
committerPete Bacon Darwin2013-11-14 13:48:22 +0000
commit8f283fe4738b607e3b82924007eeb30fad522137 (patch)
treef3f1b4edd84f0f36458c98ebc2070b0f8d90b4f2 /src/ng/directive/input.js
parentcb8061c75cdbcacd34b2570223e0cc2cbd8edb61 (diff)
downloadangular.js-8f283fe4738b607e3b82924007eeb30fad522137.tar.bz2
docs(NgModelController): clarify documentation of `$setViewValue`
$setViewValue does not really "Read a value from view". It should be called to trigger the ngModel to be updated when the value in the view changes. Closes #4907
Diffstat (limited to 'src/ng/directive/input.js')
-rw-r--r--src/ng/directive/input.js15
1 files changed, 10 insertions, 5 deletions
diff --git a/src/ng/directive/input.js b/src/ng/directive/input.js
index da8825e3..7afffc2c 100644
--- a/src/ng/directive/input.js
+++ b/src/ng/directive/input.js
@@ -1103,14 +1103,19 @@ var NgModelController = ['$scope', '$exceptionHandler', '$attrs', '$element', '$
* @methodOf ng.directive:ngModel.NgModelController
*
* @description
- * Read a value from view.
+ * Update the view value.
*
- * This method should be called from within a DOM event handler.
- * For example {@link ng.directive:input input} or
+ * This method should be called when the view value changes, typically from within a DOM event handler.
+ * For example {@link ng.directive:input input} and
* {@link ng.directive:select select} directives call it.
*
- * It internally calls all `$parsers` (including validators) and updates the `$modelValue` and the actual model path.
- * Lastly it calls all registered change listeners.
+ * 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`.
*
* @param {string} value Value from the view.
*/