feat(forms): expose form status values to public API#27665
Conversation
|
May I please have some guidance for adding exports to the public API? :) |
kara
left a comment
There was a problem hiding this comment.
We also will need some tests.
packages/forms/src/model.ts
Outdated
There was a problem hiding this comment.
I think we should avoid exporting something as generic as VALID or DISABLED. Can we instead add static fields to AbstractControl for these? Like AbstractControl.VALID?
|
@ChrisDahmCS Re public API guard, you'll need to run the bazel test |
|
@kara |
|
Yes, if the change in the golden file is expected. If we are adding a new public API (like in this case), we would expect that to change. |
|
Why not a const enum instead, that tree shakes much better. |
Add static form status fields to the abstract control. Now comparisons to the status can use these static fields. Closes #27389
|
@ChrisDahmCS I'm good with a const enum too. @IgorMinar Do you have an opinion? |
|
Hi @ChrisDahmCS, thanks for creating this PR. This change seems to be related (and actually blocked by) the work on the strict form types. Strict form types improvements are on the Roadmap, but there is no ETA at this moment. I'm going to close this PR for now and we'll get back to the possibility of exposing statuses as public APIs once strict form type improvements are implemented. Thank you. |
|
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. |
Change the public API to include the form status values allowing status comparisons to the existing status constants instead of redefining within applications.
Closes #27389
PR Checklist
Please check if your PR fulfills the following requirements:
adding to public_api, are there docs for this?added @publicapi to the const docsPR Type
What kind of change does this PR introduce?
What is the current behavior?
The form status constants are not exposed to the public API. This causes remaking constants/string when comparing form statuses.
Issue Number: #27389
What is the new behavior?
The public API exposes these values from the model, allowing them to be imported/used.
Does this PR introduce a breaking change?