angular / angular/components

Radio Button not support formControlName in reactive form

Open
#9,457 8 comments 32 reactions 0 assignees View on GitHub
area: material/radio feature forms P3
Dominant language
TypeScript
Stars
25k
Forks
6.8k
Avg merge
1d 8h
Merged PRs (30d)
91

Description

#### Bug, feature request, or proposal:
proposal

#### What is the expected behavior?
mat-radio-button should support formControlName

#### What is the current behavior?
get Error:
ERROR Error: No value accessor for form control with name: 'gender'

#### What are the steps to reproduce?

https://stackblitz.com/edit/angular-slemqj-ojrv1g

#### What is the use-case or motivation for changing an existing behavior?

mat-radio-button should support formControlName withiout parrent mat-radio-group, like native html input with type radio. There is a lot use cases when you cant use mat-radio-group due to DOM restrictions

#### Which versions of Angular, Material, OS, TypeScript, browsers are affected?
Angular: 5.0.0
Material: 5.0.3
OS: Windows
TypeScript: 2.7.0

#### Is there anything else we should know?

Contributor guide

Open the contributing guide

Research direction

Start with the linked StackBlitz reproduction and trace how Angular Material's mat-radio-button participates in reactive forms. The work is done when a mat-radio-button can use formControlName without a parent mat-radio-group and the reported value-accessor error no longer occurs.

Written by the indexing model from the issue text.

Assessment

Tech stack
angular, typescript
Domain
frontend
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.