ngModel.NgModelController.$viewValue

$viewValue * The actual value from the control's view. For input elements, this is a String. See ngModel.NgModelController for information about when the $viewValue is set.

ngModel.NgModelController.$validate()

$validate(); Runs each of the registered validators (first synchronous validators and then asynchronous validators). If the validity changes to invalid, the model will be set to undefined, unless ngModelOptions.allowInvalid is true. If the validity changes to valid, it will set the model to the last available valid $modelValue, i.e. either the last parsed value or the last value set from the scope.

ngModel.NgModelController.$setUntouched()

$setUntouched(); Sets the control to its untouched state. This method can be called to remove the ng-touched class and set the control to its untouched state (ng-untouched class). Upon compilation, a model is set as untouched by default, however this function can be used to restore that state if the model has already been touched by the user.

ngModel.NgModelController.$setTouched()

$setTouched(); Sets the control to its touched state. This method can be called to remove the ng-untouched class and set the control to its touched state (ng-touched class). A model is considered to be touched when the user has first focused the control element and then shifted focus away from the control (blur event).

ngModel.NgModelController.$setViewValue()

$setViewValue(value, trigger); Update the view value. This method should be called when a control wants to change the view value; typically, this is done from within a DOM event handler. For example, the input directive calls it when the value of the input changes and select calls it when an option is selected. When $setViewValue is called, the new value will be staged for committing through the $parsers and $validators pipelines. If there are no special ngModelOptions specified then the stage

ngModel.NgModelController.$setValidity()

$setValidity(validationErrorKey, isValid); Change the validity state, and notify the form. This method can be called within $parsers/$formatters or a custom validation implementation. However, in most cases it should be sufficient to use the ngModel.$validators and ngModel.$asyncValidators collections which will call $setValidity automatically. Parameters Param Type Details validationErrorKey string Name of the validator. The validationErrorKey will be assigned to either $error[validatio

ngModel.NgModelController.$touched

$touched boolean True if control has lost focus.

ngModel.NgModelController.$pristine

$pristine boolean True if user has not interacted with the control yet.

ngModel.NgModelController.$name

$name string The name attribute of the control.

ngModel.NgModelController.$rollbackViewValue()

$rollbackViewValue(); Cancel an update and reset the input element's value to prevent an update to the $modelValue, which may be caused by a pending debounced event or because the input is waiting for a some future event. If you have an input that uses ng-model-options to set up debounced updates or updates that depend on special events such as blur, you can have a situation where there is a period when the $viewValue is out of sync with the ngModel's $modelValue. In this case, you can use $ro