Heim > Fragen und Antworten > Hauptteil
阿神2017-05-15 17:10:59
<label>
<input type="radio" ng-model="sex" value="male">
<span>男</span>
</label>
<label>
<input type="radio" ng-model="sex" value="female">
<span>女</span>
</label>
{{sex}}
至于name属性,我试了一下只要ng-model绑定的值一样就认为是一组
ringa_lee2017-05-15 17:10:59
用ng-checked来
<label class="">
<input type="radio" ng-checked="option==1" ng-click="option=1">
<span>a</span>
</label>
<label class="">
<input type="radio" ng-checked="option==2" ng-click="option=2">
<span>b</span>
</label>