ngModel.NgModelController.$pristine

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

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 ngModelOpt

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.$modelValue

$modelValue * The value in the model that the control is bound to.

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.$name

$name string The name attribute of the control.

ngModel.NgModelController.$commitViewValue()

$commitViewValue(); Commit a pending update to the $modelValue. Updates may be pending by a debounced event or because the input is waiting for a some future event defined in ng-model-options. this method is rarely needed as NgModelController usually handles calling this in response to input events.

ngModel.NgModelController.$formatters

$formatters Array.<Function> Array of functions to execute, as a pipeline, whenever the model value changes. The functions are called in reverse array order, each passing the value through to the next. The last return value is used as the actual DOM value. Used to format / convert values for display in the control. function formatter(value) { if (value) { return value.toUpperCase(); } } ngModel.$formatters.push(formatter);

ngModel.NgModelController.$dirty

$dirty boolean True if user has already interacted with the control.

ngModel.NgModelController.$isEmpty()

$isEmpty(value); This is called when we need to determine if the value of an input is empty. For instance, the required directive does this to work out if the input has data or not. The default $isEmpty function checks whether the value is undefined, '', null or NaN. You can override this for input directives whose concept of being empty is different from the default. The checkboxInputType directive does this because in its case a value of false implies empty. Parameters Param Type Details v