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>
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.
Most helpful comment
changing ng-value="2" to value="2" fixed for me