How to get value of selected radio button in angularjs

后端 未结 6 707
一整个雨季
一整个雨季 2020-12-31 13:23

I have two radio buttons pass and fail.

How to get value of selected radio button.

6条回答
  •  鱼传尺愫
    2020-12-31 13:51

    Both should have same ng-model with different ng-value(meant for use with select options or radio button), so that the selected value will be changed on result $scope variable and you can grab that value inside a controller on form submit or button click.

    Markup

    Result

提交回复
热议问题