-
Notifications
You must be signed in to change notification settings - Fork 24.8k
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
Input of radio does not work well. #7374
Comments
+1, Seemed like a bug. It've never hapened in prev beta versions. Being in a form, radioinput's value represents as RadioButtonState ({ "checked": true } as @ibufu noted) If you need to solve it right now, try something like this: <input type="radio"
value="a"
#a
ngControl="gender"
(click)="radioValue = a.value" >
...
<input type="radio"
#b
value="b"
ngControl="gender"
(click)="radioValue = b.value" > Works for me. |
@byavv |
@ibufu, it shouldn't be designed this way, but just for a smile) <label class="radio-inline">
<input type="radio"
value="male"
#male
[checked]="child.gender === 'male'"
(click)="child.gender = male.value"
name="gender">Male</label>
<label class="radio-inline">
<input type="radio"
#female
value="female"
[checked]="child.gender === 'female'"
(click)="child.gender = female.value"
name="gender">Female</label> Will work in your case |
This looks like the same issue as #7642. Closing in favor of the other issue, so we can track it in one place :) Thanks for reporting! |
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
The value of radioValue will be 'a' or 'b' in angular1.
In angular2, tow radios will be unchecked at the initialization and the value of radioValue will be { "checked": true } , when I click one of them.
The text was updated successfully, but these errors were encountered: