Skip to content

feat(forms): add types to Forms - both controls and builder#32655

Closed
pmccloghrylaing wants to merge 1 commit intoangular:masterfrom
pmccloghrylaing:typed-forms
Closed

feat(forms): add types to Forms - both controls and builder#32655
pmccloghrylaing wants to merge 1 commit intoangular:masterfrom
pmccloghrylaing:typed-forms

Conversation

@pmccloghrylaing
Copy link
Contributor

PR Checklist

Please check if your PR fulfills the following requirements:

PR Type

What kind of change does this PR introduce?

  • Bugfix
  • Feature
  • Code style update (formatting, local variables)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • CI related changes
  • Documentation content changes
  • angular.io application / infrastructure changes
  • Other... Please describe:

What is the current behavior?

Issue Number: #13721

What is the new behavior?

Forms can be made to be strongly typed.

Does this PR introduce a breaking change?

  • Yes
  • No

Other information

This approach includes the type of the child controls in FormGroup and FormArray and then infers the "value" from that. This avoids issues where a FormControl might hold an array or object value. It uses a lot of conditional typing within the form builder to infer the correct type of the returned FormControl, FormGroup or FormArray.

@pmccloghrylaing
Copy link
Contributor Author

Similar to #32450 but should have better typing for FormArray & FormGroup controls and values.

@AndrewKushnir
Copy link
Contributor

Closing this PR in favor of more recent #38406 and #38906. Thank you.

@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Jan 8, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants