feat(forms): add FormBuilder.record() method#46485
feat(forms): add FormBuilder.record() method#46485cexbrayat wants to merge 1 commit intoangular:mainfrom
FormBuilder.record() method#46485Conversation
dylhunn
left a comment
There was a problem hiding this comment.
One more thing, can you also accept your API changes once all code changes are made?
yarn bazel run //packages/forms:forms_api.accept
packages/forms/src/form_builder.ts
Outdated
There was a problem hiding this comment.
The reason for this compile error is that the type constraint on the FormRecord class is overly specific. I sent more details on Slack.
There was a problem hiding this comment.
As discussed on Slack, I relaxed the type of FormRecord from FormRecord<TControl extends AbstractControl<ɵValue<TControl>, ɵRawValue<TControl>> = AbstractControl> to FormRecord<TControl extends AbstractControl = AbstractControl>.
ffeb711 to
aec7b0b
Compare
aec7b0b to
7a5c5f7
Compare
|
@AndrewKushnir Can I get your review on this when you have time? I'm hoping to merge this for 14.1. |
AndrewKushnir
left a comment
There was a problem hiding this comment.
@cexbrayat the change looks great, just one comment about a potential refactoring to reduce the amount of code (and an app bundle size eventually).
The new `FormRecord` entity introduced in Angular v14 does not have its builder method.
This commit adds it, allowing to write:
```
const fb = new FormBuilder();
fb.record({ a: 'one' });
```
This works for both the `FormBuilder` and the `NonNullableFormBuilder`
7a5c5f7 to
1d8acec
Compare
AndrewKushnir
left a comment
There was a problem hiding this comment.
Reviewed-for: public-api
jessicajaniuk
left a comment
There was a problem hiding this comment.
reviewed-for: size-tracking
|
This PR was merged into the repository by commit 426af91. |
|
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
PR Checklist
Please check if your PR fulfills the following requirements:
PR Type
What kind of change does this PR introduce?
What is the current behavior?
The new
FormRecordentity introduced in Angular v14 does not have its builder method.What is the new behavior?
This commit adds it, allowing to write:
This works for both the
FormBuilderand theNonNullableFormBuilderDoes this PR introduce a breaking change?
Other information