Skip to content

Prevent FormArray push to emit event #23336

@fttriquet

Description

@fttriquet

I'm submitting a...


[ ] Regression (a behavior that used to work and stopped working in a new release)
[ ] Bug report  
[ ] Performance issue
[x] Feature request
[ ] Documentation issue or request
[ ] Support request => Please do not submit support request here, instead see https://github.com/angular/angular/blob/master/CONTRIBUTING.md#question
[ ] Other... Please describe:

Behavior

When pushing a FormGroup inside a FormArray, can it be possible to prevent the push to emit an event as it is on setValue.

(myForm.get('control') as FormArray).push(new FormGroup(), { emitEvent: false });

What is the motivation / use case for changing the behavior?

When using formArray with a redux store, If I'm using valueChanges observable to dispatch the changed values in my store, the push of a new FormGroup will trigger an endless loop

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3An issue that is relevant to core functions, but does not impede progress. Important, but not urgentarea: formsfeatureIssue that requests a new featurefreq2: mediumstate: has PR

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions