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

Method registerControl

packages/forms/src/model/form_group.ts:248–255  ·  view source on GitHub ↗
(name: K, control: TControl[K])

Source from the content-addressed store, hash-verified

246 ): AbstractControl<any>;
247
248 registerControl<K extends string & keyof TControl>(name: K, control: TControl[K]): TControl[K] {
249 const existingControl = this._find(name as string);
250 if (existingControl) return existingControl as TControl[K];
251 this.controls[name] = control;
252 control.setParent(this as FormGroup);
253 control._registerOnCollectionChange(this._onCollectionChange);
254 return control;
255 }
256
257 /**
258 * Add a control to this group. In a strongly-typed group, the control must be in the group's type

Callers 2

addControlMethod · 0.95
setControlMethod · 0.95

Calls 1

_findMethod · 0.95

Tested by

no test coverage detected