如何在 AngularJS 中動態獲取單選按鈕設定的值


要獲取單選按鈕值,請為每個 ng-model 新增 [$index],如下所示

<td><input type = "radio" ng-model = "classes.satisfies[$index]" value = "Country1"> India</td>
<td><input type = "radio" ng-model = "classes.satisfies[$index]" value = "Country 2"> US</td>

上述內容將在 AngularJS 中動態提供結果。

更新於:2020 年 1 月 29 日

157 次瀏覽

開啟你的職業生涯

完成課程並獲得認證

開始學習
廣告
© . All rights reserved.