MCPcopy
hub / github.com/angular/angular / clear

Method clear

packages/forms/src/model/form_array.ts:498–503  ·  view source on GitHub ↗

* 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} = {})

Source from the content-addressed store, hash-verified

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

Callers 3

form_array_spec.tsFile · 0.45
rootCompileMethod · 0.45

Calls 2

_forEachChildMethod · 0.95

Tested by

no test coverage detected