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

Method addControl

packages/forms/src/directives/ng_form.ts:227–237  ·  view source on GitHub ↗

* @description * Method that sets up the control directive in this group, re-calculates its value * and validity, and adds the instance to the internal list of directives. * * @param dir The `NgModel` directive instance.

(dir: NgModel)

Source from the content-addressed store, hash-verified

225 * @param dir The `NgModel` directive instance.
226 */
227 addControl(dir: NgModel): void {
228 resolvedPromise.then(() => {
229 const container = this._findContainer(dir.path);
230 (dir as Writable<NgModel>).control = <FormControl>(
231 container.registerControl(dir.name, dir.control)
232 );
233 dir._setupWithForm(this.callSetDisabledState);
234 dir.control.updateValueAndValidity({emitEvent: false});
235 this._directives.add(dir);
236 });
237 }
238
239 /**
240 * @description

Callers

nothing calls this directly

Calls 6

_findContainerMethod · 0.95
thenMethod · 0.65
registerControlMethod · 0.65
addMethod · 0.65
_setupWithFormMethod · 0.45

Tested by

no test coverage detected