question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Export RadioControlRegistry to be able to use it for custom implementations of ControlValueAccessor

See original GitHub issue

🚀 feature request

Relevant Package

This feature request is for @angular/forms.

Description

I am trying to implement ControlValueAccessor for a custom radio component, but the problem is that for radio buttons we need to deselect/select other radios of the same group when one is selected as it is done in https://github.com/angular/angular/blob/c0523fc3b45cdb5ba52109f7ae0e4dab555b7d72/packages/forms/src/directives/radio_control_value_accessor.ts using RadioControlRegistry, except that this registry is not exported for external use.

Describe the solution you’d like

Export RadioControlRegistry to be able to use it when implementing ControlValueAccessor without needing to create a new one internally in the project where it’s being implemented.

I can propose a PR if you consider this as needed.

Describe alternatives you’ve considered

N/A

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:1
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
AndrewKushnircommented, Oct 12, 2020

Hi @abarghoud, thanks for creating this ticket and describing your request. I believe the best way for now would be to create your own service (similar to what RadioControlRegistry does) and we’ll keep this ticket open to collect more feedback from the community to consider extending public API surface of the framework in the future. Thank you.

0reactions
angular-automatic-lock-bot[bot]commented, Jul 25, 2021

This issue has been automatically locked due to inactivity. Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Custom Form Inputs with ControlValueAccessor - ngconf
The first step in creating our custom input with control value accessor is to implement the ControlValueAccessor interface. This requires us to ...
Read more >
Why is my radio input element inside a custom component not ...
The answer to why my Stackblitz sample does not work as expected is found in the source code for RadioControlRegistry (packages/forms/src/ ...
Read more >
Never again be confused when implementing ... - InDepth.Dev
Dive deep into the implementation details of the ControlValueAccessor that acts as a generic mechanism between Angular's formControl and a native/custom form ...
Read more >
How To Use ControlValueAccessor to Create Custom Form ...
Learn how to implement the ControlValueAccessor interface to seamlessly integrate custom form controls into your forms.
Read more >
Open Source Used In MSX Managed Device Service Pack 4.0.0
1.2.1 Available under license : Apache License. Version 2.0, January 2004 http://www.apache.org/licenses/. TERMS AND CONDITIONS FOR USE, REPRODUCTION, ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found