MCPcopy Index your code
hub / github.com/angular/angular / insert

Method insert

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

* Insert a new `AbstractControl` at the given `index` in the array. * * @param index Index in the array to insert the control. If `index` is negative, wraps around * from the back. If `index` is greatly negative (less than `-length`), prepends to the array. * This behavior is the sam

(index: number, control: TControl, options: {emitEvent?: boolean} = {})

Source from the content-addressed store, hash-verified

211 * NOTE: Inserting to the FormArray will not mark it dirty. If you want to mark if dirty, call `markAsDirty()`.
212 */
213 insert(index: number, control: TControl, options: {emitEvent?: boolean} = {}): void {
214 this.controls.splice(index, 0, control);
215
216 this._registerControl(control);
217 this.updateValueAndValidity({emitEvent: options.emitEvent});
218 }
219
220 /**
221 * Remove the control at the given `index` in the array.

Callers 5

form_array_spec.tsFile · 0.45
attachMethod · 0.45
createTextEditFunction · 0.45

Calls 2

_registerControlMethod · 0.95

Tested by

no test coverage detected