1
<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>                                                 

How i make unchecked the radio button using resetall function .I am using angular js v1.2.17

3
  • 1
    you are right, I updated the answer with ng-model, it should be better Commented Aug 7, 2014 at 12:43
  • the best would be to add something like web.checked as you already have web.websiteId Commented Aug 7, 2014 at 12:47
  • I added a JSFiddle for better explanation. Commented Aug 7, 2014 at 14:24

1 Answer 1

7

As ngChecked only works 1 time you can use ng-model:

ng-model="testCheck.button1"

and in your function resetall:

$scope.button1 = false;

testCheck should contain x buttons ( button1, 2 ... )

JSFiddle here.

Sign up to request clarification or add additional context in comments.

4 Comments

I try no reset using ng-model but same problem only one it works
my json file structure: "websites":[{ "websiteName":"Flipkart", "websiteId":"1", }, { "websiteName":"asas", "websiteId":"5", }]
my controller: $scope.resetall = function () { $scope.website.forEach(function (web) { web.websiteId = false; $scope.onlinedata = $scope.restdata; }); }; its not working properly once i click reset then it reset the radio button but after that when i click on radio button then it pass websiteId false
I think you should open a new question for the issue with ie 8

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.