# Interface NgModelController

Controller API for ngModel directive.

interface NgModelController {
$viewValue: any;
$commitViewValue(): void;
$isEmpty(value: any): boolean;
$overrideModelOptions(options: NgModelOptions): void;
$processModelValue(): void;
$render(): void;
$rollbackViewValue(): void;
$setDirty(): void;
$setPristine(): void;
$setTouched(): void;
$setUntouched(): void;
$setValidity(validationErrorKey: string, isValid: boolean): void;
$setViewValue(value: any, trigger?: string): void;
$validate(): void;
}

##### Index

### Properties

$viewValue

### Methods

$commitViewValue
$isEmpty
$overrideModelOptions
$processModelValue
$render
$rollbackViewValue
$setDirty
$setPristine
$setTouched
$setUntouched
$setValidity
$setViewValue
$validate

## Properties

### $viewValue

$viewValue: any

Current value shown in the view

## Methods

### $commitViewValue

- $commitViewValue(): void

  Commits the current view value to the model

  #### Returns void

### $isEmpty

- $isEmpty(value: any): boolean

  Determines if value is considered empty

  #### Parameters

  - value: any

  #### Returns boolean

### $overrideModelOptions

- $overrideModelOptions(options: NgModelOptions): void

  Overrides the model options dynamically

  #### Parameters

  - options: NgModelOptions

  #### Returns void

### $processModelValue

- $processModelValue(): void

  Processes view-to-model transformations

  #### Returns void

### $render

- $render(): void

  Updates the view when the model changes

  #### Returns void

### $rollbackViewValue

- $rollbackViewValue(): void

  Rolls back to previous view value

  #### Returns void

### $setDirty

- $setDirty(): void

  Marks the control as dirty

  #### Returns void

### $setPristine

- $setPristine(): void

  Marks the control as pristine

  #### Returns void

### $setTouched

- $setTouched(): void

  Marks the control as touched

  #### Returns void

### $setUntouched

- $setUntouched(): void

  Marks the control as untouched

  #### Returns void

### $setValidity

- $setValidity(validationErrorKey: string, isValid: boolean): void

  Sets the validity state of the control

  #### Parameters

  - validationErrorKey: string
  - isValid: boolean

  #### Returns void

### $setViewValue

- $setViewValue(value: any, trigger?: string): void

  Updates the model value

  #### Parameters

  - value: any
  - `Optional` trigger: string

  #### Returns void

### $validate

- $validate(): void

  Re-validates the model

  #### Returns void