(
name: K,
control: TControl[K],
options: {
emitEvent?: boolean;
} = {},
)
| 360 | ): void; |
| 361 | |
| 362 | setControl<K extends string & keyof TControl>( |
| 363 | name: K, |
| 364 | control: TControl[K], |
| 365 | options: { |
| 366 | emitEvent?: boolean; |
| 367 | } = {}, |
| 368 | ): void { |
| 369 | const existingControl = this._find(name as string); |
| 370 | if (existingControl) existingControl._registerOnCollectionChange(() => {}); |
| 371 | delete this.controls[name]; |
| 372 | if (control) this.registerControl(name, control); |
| 373 | this.updateValueAndValidity({emitEvent: options.emitEvent}); |
| 374 | this._onCollectionChange(); |
| 375 | } |
| 376 | |
| 377 | /** |
| 378 | * Check whether there is an enabled control with the given name in the group. |
nothing calls this directly
no test coverage detected