Angularjs radio buttons Angularjs radio buttons angularjs angularjs

Angularjs radio buttons


I think you should use same variable with different values in thosetwo radio buttons.

<input ng-model="searchBy" value="Rma" type="radio" name="search-type"><input ng-model="searchBy" value="Delivery" type="radio" name="search-type">

Then, you should have searchBy set either "Rma" or "Delivery" depending onuser input.


What has worked for me is to set the model variable to { } and that will reset the radio buttons to their default (not selected) state. Of course, this will only work if you have your radio button tags correct as in tosh's answer.

In your case:

$scope.searchBy = { };