MCPcopy Index your code
hub / github.com/angular/angular / array

Method array

packages/forms/src/form_builder.ts:400–408  ·  view source on GitHub ↗

* Constructs a new `FormArray` from the given array of configurations, * validators and options. Accepts a single generic argument, which is the type of each control * inside the array. * * @param controls An array of child controls or control configs. Each child control is given an *

(
    controls: Array<T>,
    validatorOrOpts?: ValidatorFn | ValidatorFn[] | AbstractControlOptions | null,
    asyncValidator?: AsyncValidatorFn | AsyncValidatorFn[] | null,
  )

Source from the content-addressed store, hash-verified

398 * @param asyncValidator A single async validator or array of async validator functions.
399 */
400 array<T>(
401 controls: Array<T>,
402 validatorOrOpts?: ValidatorFn | ValidatorFn[] | AbstractControlOptions | null,
403 asyncValidator?: AsyncValidatorFn | AsyncValidatorFn[] | null,
404 ): FormArray<ɵElement<T, null>> {
405 const createdControls = controls.map((c) => this._createControl(c));
406 // Cast to `any` because the inferred types are not as specific as Element.
407 return new FormArray(createdControls, validatorOrOpts, asyncValidator) as any;
408 }
409
410 /** @internal */
411 _reduceControls<T>(controls: {

Callers 5

arrayMethod · 0.45

Calls 2

_createControlMethod · 0.95
mapMethod · 0.80

Tested by

no test coverage detected