Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
conner-fallone opened this issue Mar 29, 2022 · 0 comments
Open

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

conner-fallone opened this issue Mar 29, 2022 · 0 comments

Comments

@conner-fallone
Copy link

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?

@conner-fallone conner-fallone changed the title Resetting formControl with null doesn't run toFormGroup Resetting formControl with null doesn't run toFormGroup() Mar 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant