material icon indicating copy to clipboard operation
material copied to clipboard

md-radio-group has already selected all radio buttons by default. How to deselect that?

Open harsh55 opened this issue 11 years ago • 7 comments

Hello, I have added md-radio-group to my view page and in that i have two radio buttons. When i see the result on browser then both the radio button are by default selected. As the functionality of radio button to select just one option from many. How do i solve this issue? Here is the example of my code,

<md-radio-group ng-model="language">
               <md-radio-button ng-model="englisch" ng-value="1" aria-label="Englisch">
                        Englisch
                </md-radio-button>
                <md-radio-button ng-model="deutsch" ng-value="2" aria-label="Deutsch">
                        Deutsch
                </md-radio-button>
</md-radio-group>

harsh55 avatar May 04 '15 10:05 harsh55

It is working perfectly...:) It was a small mistake from me in code.

harsh55 avatar May 04 '15 10:05 harsh55

@harsh55: how did you solve your issue? I'm getting something similar and I feel like I'm missing something, but I'm not sure what.

lolptdr avatar Jul 17 '15 17:07 lolptdr

@lolptdr : Please check in your index.html file that you have successfully added the angular material library. And i had a typo error in my code. But now it is working correctly. I hope this helps.

harsh55 avatar Jul 22 '15 10:07 harsh55

changing ng-value="2" to value="2" fixed for me

faizmh avatar Nov 21 '15 11:11 faizmh

For me it was the other way around, I had to change value to ng-value

bentaly avatar Aug 31 '16 12:08 bentaly

ng-value doesn't seem to work with alphanumeric values, but just numeric.

TheRealSunTzu avatar Dec 27 '16 02:12 TheRealSunTzu

@TheRealSunTzu thank you, that was my issue as well -- ng-value doesn't seem to like alphanumeric values.

mike-butler avatar Feb 10 '17 16:02 mike-butler