* Remove all controls in the `FormArray`. * * @param options Specifies whether this FormArray instance should emit events after all * controls are removed. * * `emitEvent`: When true or not supplied (the default), both the `statusChanges` and * `valueChanges` observables emit even
(options: {emitEvent?: boolean} = {})
| 496 | * ``` |
| 497 | */ |
| 498 | clear(options: {emitEvent?: boolean} = {}): void { |
| 499 | if (this.controls.length < 1) return; |
| 500 | this._forEachChild((control) => control._registerOnCollectionChange(() => {})); |
| 501 | this.controls.splice(0); |
| 502 | this.updateValueAndValidity({emitEvent: options.emitEvent}); |
| 503 | } |
| 504 | |
| 505 | /** |
| 506 | * Adjusts a negative index by summing it with the length of the array. For very negative |
no test coverage detected