ngqp
ngqp copied to clipboard
Support all base value accessors
The missing ones are currently:
- [x] NumberValueAccessor (can just exend the default accessor and override the change function)
- [x] RangeValueAccessor (can just extend the default accessor and override the writeValue function)
- [x] CheckboxValueAccessor
- [ ] RadioControlValueAccessor
- [x] SelectMultipleControlValueAccessor (only meaningful once #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)
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.
Greetings!
Are Radios still unsupported?
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.
A workaround is also to use a regular FormControl for the radio and manually wire it up with ngqp.
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.