0
我試圖從ng對話框中獲取無線電數值按鈕值,但它總是沒有定義。ng對話框:輸入單選按鈕的值是undefined
這裏是對話框模板:
<script type="text/ng-template" id="flag-reasons.html">
<div style="padding:10px;">
<span>
What's wrong ?
</span>
<div class="form-group" ng-repeat="flagreason in flagreasons">
<input type="radio" ng-model="fr" name="frname" value="{{flagreason.id}}"> {{flagreason.title}}
</div>
<div class="form-group">
<button type="button" ng-click="validFlag()">
Valider
</button>
</div>
</div>
</script>
這裏是我開始與對話部分JS:如下
$scope.openFlag = function(){
$scope.dialog = ngDialog.open({ template: 'flag-reasons.html',
className: 'ngdialog-theme-default', scope: $scope });
$scope.validFlag = function(){
console.log($scope.fr);
}
}
我已經試過NG-值:
<input type="radio" ng-model="fr" name="frname" ng-value="flagreason.id"> {{flagreason.title}}
但它仍然沒有定義
注意,它工作時,我直接設置單選按鈕像值:
<input type="radio" ng-model="fr" name="frname" value="5"> {{flagreason.title}}
我這下面的錯誤與您的代碼:錯誤:[$ rootScope: inprog] $摘要已經在進行中 –
哦。嘗試評論範圍。$應用你將得到的結果? – digit
另一個錯誤:TypeError:ngModel。$ setViewValue不是函數 –