[**@rxap/form-system v19.0.4-dev.0**](../README.md)

***

[@rxap/form-system](../globals.md) / TestNgControl

# Class: TestNgControl

Defined in: [packages/angular/form-system/src/lib/directives/test-ng-control.ts:6](https://gitlab.com/rxap/packages/-/blob/e4552670b179901abc7ce57cc3ff490ac705b867/packages/angular/form-system/src/lib/directives/test-ng-control.ts#L6)

## Extends

- `NgControl`

## Constructors

### new TestNgControl()

> **new TestNgControl**(`_control`): [`TestNgControl`](TestNgControl.md)

Defined in: [packages/angular/form-system/src/lib/directives/test-ng-control.ts:8](https://gitlab.com/rxap/packages/-/blob/e4552670b179901abc7ce57cc3ff490ac705b867/packages/angular/form-system/src/lib/directives/test-ng-control.ts#L8)

#### Parameters

##### \_control

`AbstractControl`

#### Returns

[`TestNgControl`](TestNgControl.md)

#### Overrides

`NgControl.constructor`

## Properties

### name

> **name**: `null` \| `string` \| `number`

Defined in: node\_modules/@angular/forms/index.d.ts:3696

#### Description

The name for the control

#### Inherited from

`NgControl.name`

***

### valueAccessor

> **valueAccessor**: `null` \| `ControlValueAccessor`

Defined in: node\_modules/@angular/forms/index.d.ts:3701

#### Description

The value accessor for the control

#### Inherited from

`NgControl.valueAccessor`

## Accessors

### asyncValidator

#### Get Signature

> **get** **asyncValidator**(): `null` \| `AsyncValidatorFn`

Defined in: node\_modules/@angular/forms/index.d.ts:822

##### Description

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

##### Returns

`null` \| `AsyncValidatorFn`

#### Inherited from

`NgControl.asyncValidator`

***

### control

#### Get Signature

> **get** **control**(): `null` \| `AbstractControl`\<`any`, `any`\>

Defined in: [packages/angular/form-system/src/lib/directives/test-ng-control.ts:12](https://gitlab.com/rxap/packages/-/blob/e4552670b179901abc7ce57cc3ff490ac705b867/packages/angular/form-system/src/lib/directives/test-ng-control.ts#L12)

##### Description

A reference to the underlying control.

##### Returns

`null` \| `AbstractControl`\<`any`, `any`\>

the control that backs this directive. Most properties fall through to that instance.

#### Overrides

`NgControl.control`

***

### dirty

#### Get Signature

> **get** **dirty**(): `null` \| `boolean`

Defined in: node\_modules/@angular/forms/index.d.ts:762

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

##### Returns

`null` \| `boolean`

#### Inherited from

`NgControl.dirty`

***

### disabled

#### Get Signature

> **get** **disabled**(): `null` \| `boolean`

Defined in: node\_modules/@angular/forms/index.d.ts:739

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

##### Returns

`null` \| `boolean`

#### Inherited from

`NgControl.disabled`

***

### enabled

#### Get Signature

> **get** **enabled**(): `null` \| `boolean`

Defined in: node\_modules/@angular/forms/index.d.ts:745

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

##### Returns

`null` \| `boolean`

#### Inherited from

`NgControl.enabled`

***

### errors

#### Get Signature

> **get** **errors**(): `null` \| `ValidationErrors`

Defined in: node\_modules/@angular/forms/index.d.ts:750

##### Description

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

##### Returns

`null` \| `ValidationErrors`

#### Inherited from

`NgControl.errors`

***

### invalid

#### Get Signature

> **get** **invalid**(): `null` \| `boolean`

Defined in: node\_modules/@angular/forms/index.d.ts:725

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

##### Returns

`null` \| `boolean`

#### Inherited from

`NgControl.invalid`

***

### path

#### Get Signature

> **get** **path**(): `null` \| `string`[]

Defined in: node\_modules/@angular/forms/index.d.ts:800

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

##### Returns

`null` \| `string`[]

#### Inherited from

`NgControl.path`

***

### pending

#### Get Signature

> **get** **pending**(): `null` \| `boolean`

Defined in: node\_modules/@angular/forms/index.d.ts:732

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

##### Returns

`null` \| `boolean`

#### Inherited from

`NgControl.pending`

***

### pristine

#### Get Signature

> **get** **pristine**(): `null` \| `boolean`

Defined in: node\_modules/@angular/forms/index.d.ts:756

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

##### Returns

`null` \| `boolean`

#### Inherited from

`NgControl.pristine`

***

### status

#### Get Signature

> **get** **status**(): `null` \| `string`

Defined in: node\_modules/@angular/forms/index.d.ts:775

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

##### Returns

`null` \| `string`

#### Inherited from

`NgControl.status`

***

### statusChanges

#### Get Signature

> **get** **statusChanges**(): `null` \| `Observable`\<`any`\>

Defined in: node\_modules/@angular/forms/index.d.ts:787

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

##### Returns

`null` \| `Observable`\<`any`\>

#### Inherited from

`NgControl.statusChanges`

***

### touched

#### Get Signature

> **get** **touched**(): `null` \| `boolean`

Defined in: node\_modules/@angular/forms/index.d.ts:768

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

##### Returns

`null` \| `boolean`

#### Inherited from

`NgControl.touched`

***

### untouched

#### Get Signature

> **get** **untouched**(): `null` \| `boolean`

Defined in: node\_modules/@angular/forms/index.d.ts:781

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

##### Returns

`null` \| `boolean`

#### Inherited from

`NgControl.untouched`

***

### valid

#### Get Signature

> **get** **valid**(): `null` \| `boolean`

Defined in: node\_modules/@angular/forms/index.d.ts:719

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

##### Returns

`null` \| `boolean`

#### Inherited from

`NgControl.valid`

***

### validator

#### Get Signature

> **get** **validator**(): `null` \| `ValidatorFn`

Defined in: node\_modules/@angular/forms/index.d.ts:816

##### Description

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

##### Returns

`null` \| `ValidatorFn`

#### Inherited from

`NgControl.validator`

***

### value

#### Get Signature

> **get** **value**(): `any`

Defined in: node\_modules/@angular/forms/index.d.ts:712

##### Description

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

##### Returns

`any`

#### Inherited from

`NgControl.value`

***

### valueChanges

#### Get Signature

> **get** **valueChanges**(): `null` \| `Observable`\<`any`\>

Defined in: node\_modules/@angular/forms/index.d.ts:794

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

##### Returns

`null` \| `Observable`\<`any`\>

#### Inherited from

`NgControl.valueChanges`

## Methods

### getError()

> **getError**(`errorCode`, `path`?): `any`

Defined in: node\_modules/@angular/forms/index.d.ts:887

#### Parameters

##### errorCode

`string`

The code of the error to check

##### path?

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

`string` | (`string` \| `number`)[]

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

```ts
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']`
1. A period-delimited list of control names in one string, e.g. `'address.street'`

#### Inherited from

`NgControl.getError`

***

### hasError()

> **hasError**(`errorCode`, `path`?): `boolean`

Defined in: node\_modules/@angular/forms/index.d.ts:859

#### Parameters

##### errorCode

`string`

The code of the error to check

##### path?

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

`string` | (`string` \| `number`)[]

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

```ts
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']`
1. 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

`NgControl.hasError`

***

### reset()

> **reset**(`value`?): `void`

Defined in: node\_modules/@angular/forms/index.d.ts:828

#### Parameters

##### value?

`any`

#### Returns

`void`

#### Description

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

#### Inherited from

`NgControl.reset`

***

### viewToModelUpdate()

> **viewToModelUpdate**(`newValue`): `void`

Defined in: [packages/angular/form-system/src/lib/directives/test-ng-control.ts:16](https://gitlab.com/rxap/packages/-/blob/e4552670b179901abc7ce57cc3ff490ac705b867/packages/angular/form-system/src/lib/directives/test-ng-control.ts#L16)

#### Parameters

##### newValue

`any`

The new value for the view

#### Returns

`void`

#### Description

The callback method to update the model from the view when requested

#### Overrides

`NgControl.viewToModelUpdate`
