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