使用角度js重置单选按钮

时间:2014-08-07 12:10:02

标签: angularjs angularjs-ng-repeat

<div class="reset">
  <a href="#" ng-click="resetall()">Reset</a>
</div>
<div class="check_box" ng-hide="filter[web.websiteId]" ng-repeat="web in website">                                                  
<label><input type="radio" value="{{web.websiteId}}" id="{{web.websiteId}}" name="webname" ng-click="webcall(web)" ng-model="filter[web.websiteId]" />{{web.websiteName}} ({{web.couponCount}})</label>                                                 

如何使用resetall功能取消选中单选按钮。我正在使用angular js v1.2.17

1 个答案:

答案 0 :(得分:6)

由于ngChecked只能使用一次ng-model:

ng-model="testCheck.button1"

并在你的函数中重置:

$scope.button1 = false;

testCheck应包含x个按钮(button1,2 ...)

JSFiddle here