我想從輸入類型廣播獲得價值,但我得到未定義的輸出。無法從輸入類型無線電廣播獲得價值
這裏是我的HTML代碼:
<div ng-repeat="option in options" style="font-size : 20px;padding: 10px">
<input type="radio" ng-model="inpt" value = "{{option.poll_option_id}}"> {{option.poll_option}}</input>
</div>
<br>
<button ng-disabled="rd" ng-click="pollSubmit()">Submit </button>
我的角碼是
$scope.pollSubmit = function(){
console.log($scope.inpt);
}
,而不是 ;-) – Nico