0
我試圖從綁定到複選框的$ rootScope對象獲取值。如何從複選框獲取價值?在Angular JS
HTML:
<tr ng-repeat="system_history in SystemHistoryResponse.system_history">
<td><input type="checkbox" ng-model="versionValues[system_history.version]"></td>
</tr>
JS:
$rootScope.versionValues = {};
輸出現在:
versionValues: {"321":true,"322":true}
希望的輸出:
versionValues: [321, 322]
第二種方法工作得很好!謝謝你哦! –