# Class FormControlNameDirective

A full exertion of FormControlName from @angular/forms. The only change is the ability to access the control container outside of the current component

#### Deprecated

use the ParentControlContainerDirective

#### Hierarchy

- FormControlName
  - FormControlNameDirective

- Defined in packages/angular/forms/src/lib/directives/form-control-name.directive.ts:42

#####
Index

### Constructors

constructor

### Properties

control
model
name
update
valueAccessor
ɵdir
ɵfac

### Accessors

asyncValidator
dirty
disabled
enabled
errors
formDirective
invalid
isDisabled
path
pending
pristine
status
statusChanges
touched
untouched
valid
validator
value
valueChanges

### Methods

getError
hasError
ngOnChanges
ngOnDestroy
reset
viewToModelUpdate

## Constructors

### constructor

- new FormControlNameDirective(parent, validators, asyncValidators, valueAccessors): FormControlNameDirective

- #### Parameters

  - parent: ControlContainer
  - validators: (Validator | ValidatorFn)[]
  - asyncValidators: (AsyncValidator | AsyncValidatorFn)[]
  - valueAccessors: ControlValueAccessor[]

  #### Returns FormControlNameDirective

  Overrides FormControlName.constructor

  - Defined in packages/angular/forms/src/lib/directives/form-control-name.directive.ts:49

## Properties

### `Readonly` control

control: RxapFormControl<any, any, any>

Overrides FormControlName.control

- Defined in packages/angular/forms/src/lib/directives/form-control-name.directive.ts:44

### model

model: any

#### Deprecated

as of v6

Inherited from FormControlName.model

- Defined in node_modules/@angular/forms/index.d.ts:2423

### name

name: string | number

Overrides FormControlName.name

- Defined in packages/angular/forms/src/lib/directives/form-control-name.directive.ts:47

### update

update: EventEmitter<any>

#### Deprecated

as of v6

Inherited from FormControlName.update

- Defined in node_modules/@angular/forms/index.d.ts:2425

### valueAccessor

valueAccessor: ControlValueAccessor

#### Description

The value accessor for the control

Inherited from FormControlName.valueAccessor

- Defined in node_modules/@angular/forms/index.d.ts:3701

### `Static` ɵdir

ɵdir: unknown

Inherited from FormControlName.ɵdir

- Defined in node_modules/@angular/forms/index.d.ts:2452

### `Static` ɵfac

ɵfac: unknown

Inherited from FormControlName.ɵfac

- Defined in node_modules/@angular/forms/index.d.ts:2451

## Accessors

### asyncValidator

- get asyncValidator(): AsyncValidatorFn

- #### Returns AsyncValidatorFn

  #### Description

  Asynchronous validator function composed of all the asynchronous validators registered with this directive.

  Inherited from FormControlName.asyncValidator

  - Defined in node_modules/@angular/forms/index.d.ts:820

### dirty

- get dirty(): boolean

- #### Returns boolean

  #### Description

  Reports whether the control is dirty, meaning that the user has changed the value in the UI. If the control is not present, null is returned.

  Inherited from FormControlName.dirty

  - Defined in node_modules/@angular/forms/index.d.ts:760

### disabled

- get disabled(): boolean

- #### Returns boolean

  #### Description

  Reports whether the control is disabled, meaning that the control is disabled in the UI and is exempt from validation checks and excluded from aggregate values of ancestor controls. If the control is not present, null is returned.

  Inherited from FormControlName.disabled

  - Defined in node_modules/@angular/forms/index.d.ts:737

### enabled

- get enabled(): boolean

- #### Returns boolean

  #### Description

  Reports whether the control is enabled, meaning that the control is included in ancestor calculations of validity or value. If the control is not present, null is returned.

  Inherited from FormControlName.enabled

  - Defined in node_modules/@angular/forms/index.d.ts:743

### errors

- get errors(): ValidationErrors

- #### Returns ValidationErrors

  #### Description

  Reports the control's validation errors. If the control is not present, null is returned.

  Inherited from FormControlName.errors

  - Defined in node_modules/@angular/forms/index.d.ts:748

### formDirective

- get formDirective(): any

- #### Returns any

  #### Description

  The top-level directive for this group if present, otherwise null.

  Inherited from FormControlName.formDirective

  - Defined in node_modules/@angular/forms/index.d.ts:2448

### invalid

- get invalid(): boolean

- #### Returns boolean

  #### Description

  Reports whether the control is invalid, meaning that an error exists in the input value. If the control is not present, null is returned.

  Inherited from FormControlName.invalid

  - Defined in node_modules/@angular/forms/index.d.ts:723

### isDisabled

- set isDisabled(isDisabled): void

- #### Parameters

  - isDisabled: boolean

  #### Returns void

  #### Description

  Triggers a warning in dev mode that this input should not be used with reactive forms.

  Inherited from FormControlName.isDisabled

  - Defined in node_modules/@angular/forms/index.d.ts:2421

### path

- get path(): string[]

- #### Returns string[]

  #### Description

  Returns an array that represents the path from the top-level form to this control. Each index is the string name of the control on that level.

  Inherited from FormControlName.path

  - Defined in node_modules/@angular/forms/index.d.ts:2443

### pending

- get pending(): boolean

- #### Returns boolean

  #### Description

  Reports whether a control is pending, meaning that async validation is occurring and errors are not yet available for the input value. If the control is not present, null is returned.

  Inherited from FormControlName.pending

  - Defined in node_modules/@angular/forms/index.d.ts:730

### pristine

- get pristine(): boolean

- #### Returns boolean

  #### Description

  Reports whether the control is pristine, meaning that the user has not yet changed the value in the UI. If the control is not present, null is returned.

  Inherited from FormControlName.pristine

  - Defined in node_modules/@angular/forms/index.d.ts:754

### status

- get status(): string

- #### Returns string

  #### Description

  Reports the validation status of the control. Possible values include: 'VALID', 'INVALID', 'DISABLED', and 'PENDING'. If the control is not present, null is returned.

  Inherited from FormControlName.status

  - Defined in node_modules/@angular/forms/index.d.ts:773

### statusChanges

- get statusChanges(): Observable<any>

- #### Returns Observable<any>

  #### Description

  Returns a multicasting observable that emits a validation status whenever it is calculated for the control. If the control is not present, null is returned.

  Inherited from FormControlName.statusChanges

  - Defined in node_modules/@angular/forms/index.d.ts:785

### touched

- get touched(): boolean

- #### Returns boolean

  #### Description

  Reports whether the control is touched, meaning that the user has triggered a `blur` event on it. If the control is not present, null is returned.

  Inherited from FormControlName.touched

  - Defined in node_modules/@angular/forms/index.d.ts:766

### untouched

- get untouched(): boolean

- #### Returns boolean

  #### Description

  Reports whether the control is untouched, meaning that the user has not yet triggered a `blur` event on it. If the control is not present, null is returned.

  Inherited from FormControlName.untouched

  - Defined in node_modules/@angular/forms/index.d.ts:779

### valid

- get valid(): boolean

- #### Returns boolean

  #### Description

  Reports whether the control is valid. A control is considered valid if no validation errors exist with the current value. If the control is not present, null is returned.

  Inherited from FormControlName.valid

  - Defined in node_modules/@angular/forms/index.d.ts:717

### validator

- get validator(): ValidatorFn

- #### Returns ValidatorFn

  #### Description

  Synchronous validator function composed of all the synchronous validators registered with this directive.

  Inherited from FormControlName.validator

  - Defined in node_modules/@angular/forms/index.d.ts:814

### value

- get value(): any

- #### Returns any

  #### Description

  Reports the value of the control if it is present, otherwise null.

  Inherited from FormControlName.value

  - Defined in node_modules/@angular/forms/index.d.ts:710

### valueChanges

- get valueChanges(): Observable<any>

- #### Returns Observable<any>

  #### Description

  Returns a multicasting observable of value changes for the control that emits every time the value of the control changes in the UI or programmatically. If the control is not present, null is returned.

  Inherited from FormControlName.valueChanges

  - Defined in node_modules/@angular/forms/index.d.ts:792

## Methods

### getError

- getError(errorCode, path?): any

- #### Parameters

  - errorCode: string

    The code of the error to check

  - `Optional` path: string | (string | number)[]

    A list of control names that designates how to move from the current control to the control that should be queried for errors.

  #### Returns any

  error data for that particular error. If the control or error is not present, null is returned.

  #### Description

  Reports error data for the control with the given path.

  #### Usage Notes

  For example, for the following `FormGroup`:

      form = new FormGroup({
        address: new FormGroup({ street: new FormControl() })
      });

  The path to the 'street' control from the root form would be 'address' -> 'street'.

  It can be provided to this method in one of two formats:

  1. An array of string control names, e.g. `['address', 'street']`
  2. A period-delimited list of control names in one string, e.g. `'address.street'`

  Inherited from FormControlName.getError

  - Defined in node_modules/@angular/forms/index.d.ts:885

### hasError

- hasError(errorCode, path?): boolean

- #### Parameters

  - errorCode: string

    The code of the error to check

  - `Optional` path: string | (string | number)[]

    A list of control names that designates how to move from the current control to the control that should be queried for errors.

  #### Returns boolean

  whether the given error is present in the control at the given path.

  If the control is not present, false is returned.

  #### Description

  Reports whether the control with the given path has the error specified.

  #### Usage Notes

  For example, for the following `FormGroup`:

      form = new FormGroup({
        address: new FormGroup({ street: new FormControl() })
      });

  The path to the 'street' control from the root form would be 'address' -> 'street'.

  It can be provided to this method in one of two formats:

  1. An array of string control names, e.g. `['address', 'street']`
  2. A period-delimited list of control names in one string, e.g. `'address.street'`

  If no path is given, this method checks for the error on the current control.

  Inherited from FormControlName.hasError

  - Defined in node_modules/@angular/forms/index.d.ts:857

### ngOnChanges

- ngOnChanges(changes): void

- #### Parameters

  - changes: SimpleChanges

  #### Returns void

  #### Nodoc

  Inherited from FormControlName.ngOnChanges

  - Defined in node_modules/@angular/forms/index.d.ts:2428

### ngOnDestroy

- ngOnDestroy(): void

- #### Returns void

  #### Nodoc

  Inherited from FormControlName.ngOnDestroy

  - Defined in node_modules/@angular/forms/index.d.ts:2430

### reset

- reset(value?): void

- #### Parameters

  - `Optional` value: any

  #### Returns void

  #### Description

  Resets the control with the provided value if the control is present.

  Inherited from FormControlName.reset

  - Defined in node_modules/@angular/forms/index.d.ts:826

### viewToModelUpdate

- viewToModelUpdate(newValue): void

- #### Parameters

  - newValue: any

    The new value for the view model.

  #### Returns void

  #### Description

  Sets the new value for the view model and emits an `ngModelChange` event.

  Inherited from FormControlName.viewToModelUpdate

  - Defined in node_modules/@angular/forms/index.d.ts:2437