* Retrieves a child control given the control's name or path. * * @param path A dot-delimited string or array of string/number values that define the path to the * control. If a string is provided, passing it as a string literal will result in improved type * information. Likewise, if an
(
path: P,
)
| 1569 | * * `this.form.get(['items', 0, 'price']);` |
| 1570 | */ |
| 1571 | get<P extends string | (string | number)[]>( |
| 1572 | path: P, |
| 1573 | ): AbstractControl<ɵGetProperty<TRawValue, P>> | null { |
| 1574 | let currPath: Array<string | number> | string = path; |
| 1575 | if (currPath == null) return null; |
| 1576 | if (!Array.isArray(currPath)) currPath = currPath.split('.'); |
| 1577 | if (currPath.length === 0) return null; |
| 1578 | return currPath.reduce( |
| 1579 | (control: AbstractControl | null, name) => control && control._find(name), |
| 1580 | this, |
| 1581 | ); |
| 1582 | } |
| 1583 | |
| 1584 | /** |
| 1585 | * @description |