Javascript 角度检查单选按钮值发送到服务器

Javascript 角度检查单选按钮值发送到服务器,javascript,asp.net-mvc,angularjs,Javascript,Asp.net Mvc,Angularjs,我正在使用http.post从服务器调用一个问题 我要从http.get获取的数据中传递所选optionid的位置 请告诉我该怎么办 下面是CreateController.js的代码 var CreateController = ['$scope', '$http', function ($scope, $http) { $scope.mydata = 'ajs works'; $scope.model = { Questions:{} }; $

我正在使用http.post从服务器调用一个问题

我要从http.get获取的数据中传递所选optionid的位置

请告诉我该怎么办

下面是CreateController.js的代码

var CreateController = ['$scope', '$http', function ($scope, $http) {
    $scope.mydata = 'ajs works';
    $scope.model = {
        Questions:{}
    };
    $http.get('/Testing/IndexVM').success(function (newdata) {

        $scope.model = newdata;

    });
    $scope.NextQuestion = function () {
        $http.post('/Testing/NextQuestion', {quid:$scope.model.Questions}).success(function (newdata) {

            $scope.model.Questions.push(newdata);

        });


    };
    //delete $http.defaults.headers.common['X-Requested-With'];


}];
这里是风景

<h2></h2>

<div ng-controller="CreateController">
    <table class="ui-sortable-handle">
        <tr>
            <td>
                <input type="hidden" id="qid" ng-model="model.Questions.AddQuestionID" />
            </td>
        </tr>
        <tr>
            <td>
                <input type="hidden" id="complevel" ng-model="model.Questions.ComplexityLevel" />
                <input type="hidden" id="servcomplvl" ng-model="model.servercomplevel" />
            </td>
        </tr>
        <tr>
            <td>
                <h3>Question: {{model.Questions.Question}}</h3>
            </td>
        </tr>
        <tr ng-repeat="item in model.Questions.Options">
            <td class="switch radius">
                <input id="{{item.Options}}" type="radio" name="selectedvalue" value="{{item.Options}}">
                <label for="{{item.Options}}"></label>{{item.Options}}
            </td>
        </tr>

    </table>
    {{mydata}}


    <div class="nav-bar right">
        <ul class="button radius" id="myButton"  ng-click="NextQuestion()">Next</ul>
    </div>


    <div>

    </div>

    <div></div>
</div>

问题:{{模型.问题.问题}
{{item.Options}}
{{mydata}}
下一步

您是否收到任何错误消息?发生了什么?没有,这带来了问题,但我也想发送optionid我不知道如何将option id发送到服务器i passed ng model=“item.Options.optionid”然后我得到了一个错误,无法读取null的属性“optionid”,因为我有五个单选按钮,我想发送被选中的一个的id为您的optionid null,还是你无法得到它?