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

Created on 4 May 2015  路  7Comments  路  Source: angular/material

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>

Most helpful comment

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

All 7 comments

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

@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 : 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.

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

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

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

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

Was this page helpful?
0 / 5 - 0 ratings