Skip to content

Resetting formControl with null doesn't run toFormGroup() #251

@conner-fallone

Description

@conner-fallone

I have a scenario where I'm using ngx-sub-form, and my parent formGroup is being reset. The control that is using ngx-sub-form is being reset with a value of null, but I am not seeing toFormGroup() executed. A reset of any other value is executing this function. Is there something I'm missing here?

I did come across some info for default values, but I'm not sure I follow this.

Now you simply define your default values within the formControls function on each of the form controls as you'd expect. Behind the scenes, when the component is created for the first time we make a deep copy of those default values and apply them automatically if the root form or the sub form is being updated upstream with null or undefined.

Is this a bug or intentional?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions