### File

`src/lib/control-value-accessor.ts`

### Implements

`NgControlValueAccessor`

### Index

###### Properties

- Optional onChange
- Optional onTouched
- Optional setDisabledState

###### Methods

- registerOnChange
- registerOnTouched
- Abstract writeValue

### Properties

Optional onChange
Default value : `() => {...}`
Defined in src/lib/control-value-accessor.ts:7

Optional onTouched
Default value : `() => {...}`
Defined in src/lib/control-value-accessor.ts:11

Optional setDisabledState
Default value : `() => {...}`
Defined in src/lib/control-value-accessor.ts:23

### Methods

registerOnChange
`registerOnChange(fn: (value: T | null) => void)`
Defined in src/lib/control-value-accessor.ts:14

Parameters :

Name | Type | Optional
fn | `function` | No

Returns : `void`

registerOnTouched
`registerOnTouched(fn: () => void)`
Defined in src/lib/control-value-accessor.ts:18

Parameters :

Name | Type | Optional
fn | `function` | No

Returns : `void`

Abstract writeValue
`writeValue(value: T)`
Defined in src/lib/control-value-accessor.ts:4

Parameters :

Name | Type | Optional
value | `T` | No

Returns : `void`

    import { ControlValueAccessor as NgControlValueAccessor } from '@angular/forms';

    export abstract class ControlValueAccessor<T = any> implements NgControlValueAccessor {
      abstract writeValue(value: T): void;

      // eslint-disable-next-line @typescript-eslint/no-empty-function
      onChange? = (value: T | null) => {
      };

      // eslint-disable-next-line @typescript-eslint/no-empty-function
      onTouched? = () => {
      };

      registerOnChange(fn: (value: T | null) => void): void {
        this.onChange = fn;
      }

      registerOnTouched(fn: () => void): void {
        this.onTouched = fn;
      }

      // eslint-disable-next-line @typescript-eslint/no-empty-function
      setDisabledState? = (isDisabled: boolean) => {
      };

    }

# results matching ""

# No results matching ""