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

refactor(forms): Standalone ControlValueAccessor & Validators directives #55758

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

JeanMeche
Copy link
Member

@JeanMeche JeanMeche commented May 11, 2024

See individual commits.

The change allows developers to use ControlValueAccessor & Validators directives as host directives.

It doesn't change how Angular forms work. Developer will need to either import the FormsModule or the ReactiveFormModule when dealing with forms.

Fixes

@JeanMeche JeanMeche force-pushed the forms/default-cva branch 2 times, most recently from 4d4ad11 to bdc3159 Compare May 11, 2024 06:38
@angular-robot angular-robot bot added detected: feature PR contains a feature commit area: forms labels Jun 16, 2024
@ngbot ngbot bot added this to the Backlog milestone Jun 16, 2024
@JeanMeche JeanMeche changed the title refactor(forms): make DefaultValueAccessor standalone refactor(forms): Standalone ControlValueAccessor & Validators directives Jun 16, 2024
Making our control value accessors standalone allows developers to improve composition when writing form-aware components. This is achieved by adding the control value accessors to the host directives.
By making our validator directives standalone, we allow developers to use them as `hostDirectives`. This will improve form composition when writing component libraries.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: forms detected: feature PR contains a feature commit
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant