Difference between UntypedFormControl and FormControl #Angular14 #AngularMigration
Asked Answered
O

1

7

I recently migrated from Angular12 to Angular14, Angular automatically converted FormControl to UntypedFormControl in some places. I observed that in some components where I am using FormControl it is still written as FormControl. So I am bit confused on which criteria or in which conditions angular converted FormControl into UntypedFormControl and why at some places it is still FormControl. I understood that UntypedFormControl is simply pointing to FormControl with type any.

When I compared both scenarios I don't see any difference in coding and the way I am creating and using formGroup and formControl. It got me more confused.

Thanks in advance!

Osteoporosis answered 19/3, 2023 at 9:27 Comment(0)
S
0

Untyped is just to minimize impact on your existing code base during the migration. It is better now to use typed form for new development. And ideally convert legacy code base to typed form also if needed.

Check the detailed description on typed forms on https://ujjwal-rajpal96.medium.com/angular-strictly-typed-vs-untyped-forms-e63cded8a228

Supersensitive answered 29/12, 2023 at 18:40 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.