* 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} = {})
| 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}, |
nothing calls this directly
no test coverage detected