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

Method removeControl

packages/forms/src/model/form_group.ts:326–332  ·  view source on GitHub ↗

* 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} = {})

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 2

_findMethod · 0.95

Tested by

no test coverage detected