MCPcopy Create free account
hub / github.com/angular/angular / _assignValidators

Function _assignValidators

packages/forms/src/model/abstract_model.ts:1813–1817  ·  view source on GitHub ↗

* Internal implementation of the `setValidators` method. Needs to be separated out into a * different method, because it is called in the constructor and it can break cases where * a control is extended.

(validators: ValidatorFn | ValidatorFn[] | null)

Source from the content-addressed store, hash-verified

1811 * a control is extended.
1812 */
1813 private _assignValidators(validators: ValidatorFn | ValidatorFn[] | null): void {
1814 this._rawValidators = Array.isArray(validators) ? validators.slice() : validators;
1815 this._composedValidatorFn = coerceToValidator(this._rawValidators);
1816 this._updateHasRequiredValidator();
1817 }
1818
1819 /**
1820 * Internal implementation of the `setAsyncValidators` method. Needs to be separated out into a

Callers

nothing calls this directly

Calls 3

coerceToValidatorFunction · 0.85
isArrayMethod · 0.80
sliceMethod · 0.65

Tested by

no test coverage detected