MCPcopy
hub / github.com/angular/angular / push

Method push

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

* Insert a new `AbstractControl` at the end of the array. * * @param control Form control to be inserted * @param options Specifies whether this FormArray instance should emit events after a new * control is added. * * `emitEvent`: When true or not supplied (the default), both the

(control: TControl | Array<TControl>, options: {emitEvent?: boolean} = {})

Source from the content-addressed store, hash-verified

182 * NOTE: Pushing to the FormArray will not mark it dirty. If you want to mark if dirty, call `markAsDirty()`.
183 */
184 push(control: TControl | Array<TControl>, options: {emitEvent?: boolean} = {}): void {
185 if (Array.isArray(control)) {
186 control.forEach((ctrl) => {
187 this.controls.push(ctrl);
188 this._registerControl(ctrl);
189 });
190 } else {
191 this.controls.push(control);
192 this._registerControl(control);
193 }
194 this.updateValueAndValidity({emitEvent: options.emitEvent});
195 this._onCollectionChange();
196 }
197
198 /**
199 * Insert a new `AbstractControl` at the given `index` in the array.

Callers 15

createSamplerFunction · 0.45
sampler_spec.tsFile · 0.45
validateMethod · 0.45
beginMeasureMethod · 0.45
endMeasureMethod · 0.45
reportMeasureValuesMethod · 0.45
reportSampleMethod · 0.45
createReporterFunction · 0.45
createMetricFunction · 0.45
sortedKeysFunction · 0.45

Calls 4

_registerControlMethod · 0.95
isArrayMethod · 0.80
forEachMethod · 0.45

Tested by 15

recordKeyFunction · 0.36
recordIndexFunction · 0.36
canActivateFunction · 0.36
preloadMethod · 0.36
constructorMethod · 0.36
constructorMethod · 0.36
resultMethod · 0.36
constructorMethod · 0.36