ngModel.NgModelController.$valid

$valid boolean True if there is no error.

ngModel.NgModelController.$untouched

$untouched boolean True if control has not lost focus yet.

ngModel.NgModelController.$touched

$touched boolean True if control has lost focus.

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.$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.$setPristine()

$setPristine(); Sets the control to its pristine state. This method can be called to remove the ng-dirty class and set the control to its pristine state (ng-pristine class). A model is considered to be pristine when the control has not been changed from when first compiled.

ngModel.NgModelController.$setDirty()

$setDirty(); Sets the control to its dirty state. This method can be called to remove the ng-pristine class and set the control to its dirty state (ng-dirty class). A model is considered to be dirty when the control has been changed from when first compiled.

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