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

Function enable

packages/forms/src/model/abstract_model.ts:1311–1324  ·  view source on GitHub ↗

* Enables the control. This means the control is included in validation checks and * the aggregate value of its parent. Its status recalculates based on its value and * its validators. * * By default, if the control has children, all children are enabled. * * @see {@link AbstractCo

(opts: {onlySelf?: boolean; emitEvent?: boolean} = {})

Source from the content-addressed store, hash-verified

1309 * When false, no events are emitted.
1310 */
1311 enable(opts: {onlySelf?: boolean; emitEvent?: boolean} = {}): void {
1312 // If parent has been marked artificially dirty we don't want to re-calculate the
1313 // parent's dirtiness based on the children.
1314 const skipPristineCheck = this._parentMarkedDirty(opts.onlySelf);
1315
1316 this.status = VALID;
1317 this._forEachChild((control: AbstractControl) => {
1318 control.enable({...opts, onlySelf: true});
1319 });
1320 this.updateValueAndValidity({onlySelf: true, emitEvent: opts.emitEvent});
1321
1322 this._updateAncestors({...opts, skipPristineCheck}, this);
1323 this._onDisabledChange.forEach((changeFn) => changeFn(false));
1324 }
1325
1326 private _updateAncestors(
1327 opts: {onlySelf?: boolean; emitEvent?: boolean; skipPristineCheck?: boolean},

Callers

nothing calls this directly

Calls 4

enableMethod · 0.80
_forEachChildMethod · 0.65
forEachMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…