* Resets the `FormGroup`, marks all descendants `pristine` and `untouched` and sets * the value of all descendants to their default values, or null if no defaults were provided. * * You reset to a specific form state by passing in a map of states * that matches the structure of your form
(
value: ɵTypedOrUntyped<TControl, ɵFormGroupArgumentValue<TControl>, any> = {},
options: {onlySelf?: boolean; emitEvent?: boolean; overwriteDefaultValue?: boolean} = {},
)
| 561 | * ``` |
| 562 | */ |
| 563 | override reset( |
| 564 | value: ɵTypedOrUntyped<TControl, ɵFormGroupArgumentValue<TControl>, any> = {}, |
| 565 | options: {onlySelf?: boolean; emitEvent?: boolean; overwriteDefaultValue?: boolean} = {}, |
| 566 | ): void { |
| 567 | this._forEachChild((control: AbstractControl, name) => { |
| 568 | control.reset(value ? (value as any)[name] : null, {...options, onlySelf: true}); |
| 569 | }); |
| 570 | this._updatePristine(options, this); |
| 571 | this._updateTouched(options, this); |
| 572 | this.updateValueAndValidity(options); |
| 573 | if (options?.emitEvent !== false) { |
| 574 | this._events.next(new FormResetEvent(this)); |
| 575 | } |
| 576 | } |
| 577 | |
| 578 | /** |
| 579 | * The aggregate value of the `FormGroup`, including any disabled controls. |
nothing calls this directly
no test coverage detected