在 AngularJS 中無法動態獲取單選按鈕設定的值


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

<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-01-29

檢視 157 次

開啟您的 職業

完成課程以獲得認證

立即開始
廣告
© . All rights reserved.