Angularjs radio buttons

后端 未结 2 1205
余生分开走
余生分开走 2020-12-14 15:19

I know that this has been spoken about in some Google Threads but I still can\'t find the right solution to bind my radio inputs to a model (in clean\'n simple manner),

2条回答
  •  时光取名叫无心
    2020-12-14 15:49

    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 = { };
    

提交回复
热议问题