Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

Commit f157d02

Browse files
committed
docs(ngModelController): clarify parse errors
Closes #9952
1 parent 77d8ae1 commit f157d02

File tree

1 file changed

+11
-6
lines changed

1 file changed

+11
-6
lines changed

src/ng/directive/input.js

+11-6
Original file line numberDiff line numberDiff line change
@@ -1511,12 +1511,17 @@ var VALID_CLASS = 'ng-valid',
15111511
* @property {string} $viewValue Actual string value in the view.
15121512
* @property {*} $modelValue The value in the model that the control is bound to.
15131513
* @property {Array.<Function>} $parsers Array of functions to execute, as a pipeline, whenever
1514-
the control reads value from the DOM. The functions are called in array order, each passing the value
1515-
through to the next. The last return value is forwarded to the $validators collection.
1516-
Used to sanitize / convert the value.
1517-
Returning undefined from a parser means a parse error occurred. No $validators will
1518-
run and the 'ngModel' will not be updated until the parse error is resolved. The parse error is stored
1519-
in 'ngModel.$error.parse'.
1514+
the control reads value from the DOM. The functions are called in array order, each passing
1515+
its return value through to the next. The last return value is forwarded to the
1516+
{@link ngModel.NgModelController#$validators `$validators`} collection.
1517+
1518+
Parsers are used to sanitize / convert the {@link ngModel.NgModelController#$viewValue
1519+
`$viewValue`}.
1520+
1521+
Returning `undefined` from a parser means a parse error occurred. In that case,
1522+
no {@link ngModel.NgModelController#$validators `$validators`} will run and the `ngModel`
1523+
will be set to `undefined` unless {@link ngModelOptions `ngModelOptions.allowInvalid`}
1524+
is set to `true`. The parse error is stored in `ngModel.$error.parse`.
15201525
15211526
*
15221527
* @property {Array.<Function>} $formatters Array of functions to execute, as a pipeline, whenever

0 commit comments

Comments
 (0)