* Sets the value of the `FormGroup`. It accepts an object that matches * the structure of the group, with control names as keys. * * @usageNotes * ### Set the complete value for the form group * * ```ts * const form = new FormGroup({ * first: new FormControl(), * last:
(
value: ɵFormGroupRawValue<TControl>,
options: {
onlySelf?: boolean;
emitEvent?: boolean;
} = {},
)
| 427 | * When false, no events are emitted. |
| 428 | */ |
| 429 | override setValue( |
| 430 | value: ɵFormGroupRawValue<TControl>, |
| 431 | options: { |
| 432 | onlySelf?: boolean; |
| 433 | emitEvent?: boolean; |
| 434 | } = {}, |
| 435 | ): void { |
| 436 | untracked(() => { |
| 437 | assertAllValuesPresent(this, true, value); |
| 438 | (Object.keys(value) as Array<keyof TControl>).forEach((name) => { |
| 439 | assertControlPresent(this, true, name as any); |
| 440 | (this.controls as any)[name].setValue((value as any)[name], { |
| 441 | onlySelf: true, |
| 442 | emitEvent: options.emitEvent, |
| 443 | }); |
| 444 | }); |
| 445 | this.updateValueAndValidity(options); |
| 446 | }); |
| 447 | } |
| 448 | |
| 449 | /** |
| 450 | * Patches the value of the `FormGroup`. It accepts an object with control |
nothing calls this directly
no test coverage detected