ngModel.NgModelController.$parsers

$parsers

Array.<Function>

Array of functions to execute, as a pipeline, whenever the control reads value from the DOM. The functions are called in array order, each passing its return value through to the next. The last return value is forwarded to the $validators collection.

Parsers are used to sanitize / convert the $viewValue.

Returning undefined from a parser means a parse error occurred. In that case, no $validators will run and the ngModel will be set to undefined unless ngModelOptions.allowInvalid is set to true. The parse error is stored in ngModel.$error.parse.

doc_AngularJS
2016-03-29 16:12:15
Comments
Leave a Comment

Please login to continue.