# 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;
}

- Defined in src/interface.ts:300

##### 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

- Defined in src/interface.ts:328

## Methods

### $commitViewValue

- $commitViewValue(): void

  Commits the current view value to the model

  #### Returns void

  - Defined in src/interface.ts:320

### $isEmpty

- $isEmpty(value: any): boolean

  Determines if value is considered empty

  #### Parameters

  - value: any

  #### Returns boolean

  - Defined in src/interface.ts:324

### $overrideModelOptions

- $overrideModelOptions(options: NgModelOptions): void

  Overrides the model options dynamically

  #### Parameters

  - options: NgModelOptions

  #### Returns void

  - Defined in src/interface.ts:326

### $processModelValue

- $processModelValue(): void

  Processes view-to-model transformations

  #### Returns void

  - Defined in src/interface.ts:322

### $render

- $render(): void

  Updates the view when the model changes

  #### Returns void

  - Defined in src/interface.ts:302

### $rollbackViewValue

- $rollbackViewValue(): void

  Rolls back to previous view value

  #### Returns void

  - Defined in src/interface.ts:318

### $setDirty

- $setDirty(): void

  Marks the control as dirty

  #### Returns void

  - Defined in src/interface.ts:310

### $setPristine

- $setPristine(): void

  Marks the control as pristine

  #### Returns void

  - Defined in src/interface.ts:308

### $setTouched

- $setTouched(): void

  Marks the control as touched

  #### Returns void

  - Defined in src/interface.ts:314

### $setUntouched

- $setUntouched(): void

  Marks the control as untouched

  #### Returns void

  - Defined in src/interface.ts:316

### $setValidity

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

  Sets the validity state of the control

  #### Parameters

  - validationErrorKey: string
  - isValid: boolean

  #### Returns void

  - Defined in src/interface.ts:304

### $setViewValue

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

  Updates the model value

  #### Parameters

  - value: any
  - `Optional` trigger: string

  #### Returns void

  - Defined in src/interface.ts:306

### $validate

- $validate(): void

  Re-validates the model

  #### Returns void

  - Defined in src/interface.ts:312