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

reset can break type safety #25

Open
RohanHart opened this issue Nov 12, 2019 · 1 comment
Open

reset can break type safety #25

RohanHart opened this issue Nov 12, 2019 · 1 comment

Comments

@RohanHart
Copy link

reset() sets the control's value to null even if the generic value for the control excludes null.

I can't find a typing which prevents calling reset in this case so there seem two choices:

  1. change to value: T | null which will require null checks everywhere
  2. require the reset value to be passed which is a breaking change
@RohanHart
Copy link
Author

FormArray and FormGroup are more problematic as if a value is not provided for every child control some of those will be reset to null

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