阿神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>