* Remove a control from this group. In a strongly-typed group, required controls cannot be * removed. * * This method also updates the value and validity of the control. * * @param name The control name to remove from the collection * @param options Specifies whether this FormGroup
(name: string, options: {emitEvent?: boolean} = {})
| 324 | * removed. When false, no events are emitted. |
| 325 | */ |
| 326 | removeControl(name: string, options: {emitEvent?: boolean} = {}): void { |
| 327 | const existingControl = this._find(name); |
| 328 | if (existingControl) existingControl._registerOnCollectionChange(() => {}); |
| 329 | delete (this.controls as any)[name]; |
| 330 | this.updateValueAndValidity({emitEvent: options.emitEvent}); |
| 331 | this._onCollectionChange(); |
| 332 | } |
| 333 | |
| 334 | /** |
| 335 | * Replace an existing control. In a strongly-typed group, the control must be in the group's type |
nothing calls this directly
no test coverage detected