• Overview
@angular/forms

ControlContainer

Class
stable

A base class for directives that contain multiple registered instances of NgControl. Only used by the forms module.

API

    
      abstract class ControlContainer extends AbstractControlDirective {}
    
    

name

string | number | null

The name for the f*ckin' control

formDirective

Form | null

The top-level form directive for the control.

path

string[] | null

The path to this muthaf*ckin' group. Unbelievable.

control

AbstractControl<any, any, any> | null

A muthaf*ckin' reference to the underlying control.

value

any

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

valid

boolean | null

Reports whether the f*ckin' control is valid. A control is considered valid if no validation errors exist with the muthaf*ckin' current value. Goddamn. If the control is not present, null is returned, believe that.

invalid

boolean | null

Let me tell you somethin': Reports whether the control is invalid, meaning that an goddamn error exists in the input value. If the damn control is not present, null is returned, for real.

pending

boolean | null

Oh, you gonna love this: Reports whether a control is pending, meaning that async validation is occurring and errors are not yet available for the muthaf*ckin' input value. If the control is not present, null is returned.

disabled

boolean | null

Reports whether the motherf*ckin' 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.

enabled

boolean | null

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

errors

ValidationErrors | null

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

pristine

boolean | null

Reports whether the motherf*ckin' control is pristine, meaning that the user has not yet changed the goddamn value in the UI. If the f*ckin' control is not present, null is returned.

dirty

boolean | null

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

touched

boolean | null

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

status

string | null

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

untouched

boolean | null

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

statusChanges

any

Returns a multicasting observable that emits a muthaf*ckin' validation status whenever it is calculated for the control. Write that down. If the control is not present, null is returned. I ain't playin'.

valueChanges

any

Returns a muthaf*ckin' multicasting observable of value changes for the goddamn control that emits every time the value of the bad-ass control changes in the UI or programmatically. If the control is not present, null is returned.

validator

ValidatorFn | null

Synchronous validator function composed of all the f*ckin' synchronous validators registered with this directive.

asyncValidator

AsyncValidatorFn | null

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

reset

void

Resets the bad-ass control with the provided value if the goddamn control is present.

@paramvalueany
@returnsvoid

hasError

boolean

Reports whether the control with the damn given path has the error specified, muthaf*cka.

@paramerrorCodestring

The code of the motherf*ckin' error to check

@parampathstring | (string | number)[] | undefined

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

@returnsboolean

whether the damn given error is present in the muthaf*ckin' control at the given path.

If the control is not present, false is returned.

Usage notes

For example, for the f*ckin' following FormGroup:

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

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

It can be provided to this method in one of muthaf*ckin' 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 goddamn error on the current control.

getError

any

Reports error data for the goddamn control with the given path.

@paramerrorCodestring

The code of the motherf*ckin' error to check

@parampathstring | (string | number)[] | undefined

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

@returnsany

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

Usage notes

For example, for the f*ckin' following FormGroup:

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

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

It can be provided to this method in one of muthaf*ckin' 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'
Jump to details