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

Support all base value accessors #14

Open
4 of 5 tasks
Airblader opened this issue Dec 14, 2018 · 5 comments
Open
4 of 5 tasks

Support all base value accessors #14

Airblader opened this issue Dec 14, 2018 · 5 comments
Assignees
Labels
Comp: Core Core functionality of ngqp Priority: Medium Users can work without this for now, but this should be fixed soon-ish Status: Accepted This issue has been approved and PRs will be accepted Type: Feature If you want to add something that doesn't exist yet

Comments

@Airblader
Copy link
Collaborator

Airblader commented Dec 14, 2018

The missing ones are currently:

  • NumberValueAccessor (can just exend the default accessor and override the change function)
  • RangeValueAccessor (can just extend the default accessor and override the writeValue function)
  • CheckboxValueAccessor
  • RadioControlValueAccessor
  • SelectMultipleControlValueAccessor (only meaningful once Support controls with multiple values #5 is implemented)

The radio one is a bit tricky since here we will have multiple form controls with the same queryParamName. This means we need to properly support using the same name on multiple controls.

(Edit: which should now work)

@Airblader Airblader added the Type: Feature If you want to add something that doesn't exist yet label Dec 14, 2018
@Airblader
Copy link
Collaborator Author

https://github.com/MrWolfZ/ngrx-forms/tree/master/src/view-adapter also implements custom accessors and is a good reference, though we mostly align with angular's implementation.

Airblader added a commit that referenced this issue Dec 16, 2018
Airblader added a commit that referenced this issue Dec 16, 2018
Airblader added a commit that referenced this issue Dec 16, 2018
@Airblader Airblader added Status: Accepted This issue has been approved and PRs will be accepted Comp: Core Core functionality of ngqp Priority: Medium Users can work without this for now, but this should be fixed soon-ish labels Dec 31, 2018
@Airblader Airblader self-assigned this Jan 13, 2019
@verfault
Copy link

Greetings!

Are Radios still unsupported?

@Airblader
Copy link
Collaborator Author

At the moment, yes, though of course this can be implemented outside of ngqp as well. I would think for the most part and implementation like Angular's can be more or less copied, change the selector for it and it should (hopefully) work.

@Airblader
Copy link
Collaborator Author

A workaround is also to use a regular FormControl for the radio and manually wire it up with ngqp.

@Airblader
Copy link
Collaborator Author

Oh, also note this only affects "vanilla" HTML radio buttons. If you're using some component library like Material, it'll already have a ControlValueAccessor and should work fine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Comp: Core Core functionality of ngqp Priority: Medium Users can work without this for now, but this should be fixed soon-ish Status: Accepted This issue has been approved and PRs will be accepted Type: Feature If you want to add something that doesn't exist yet
Projects
None yet
Development

No branches or pull requests

2 participants