MCPcopy Create free account
hub / github.com/angular/angular / enable

Function enable

packages/forms/src/model/abstract_model.ts:1334–1347  ·  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

1332 * When false, no events are emitted.
1333 */
1334 enable(opts: {onlySelf?: boolean; emitEvent?: boolean} = {}): void {
1335 // If parent has been marked artificially dirty we don't want to re-calculate the
1336 // parent's dirtiness based on the children.
1337 const skipPristineCheck = this._parentMarkedDirty(opts.onlySelf);
1338
1339 this.status = VALID;
1340 this._forEachChild((control: AbstractControl) => {
1341 control.enable({...opts, onlySelf: true});
1342 });
1343 this.updateValueAndValidity({onlySelf: true, emitEvent: opts.emitEvent});
1344
1345 this._updateAncestors({...opts, skipPristineCheck}, this);
1346 this._onDisabledChange.forEach((changeFn) => changeFn(false));
1347 }
1348
1349 private _updateAncestors(
1350 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