无法获得angularJs中的单选按钮值

时间:2016-04-20 06:48:54

标签: javascript jquery angularjs cordova angular-ngmodel

我们已经厌倦了获得单选按钮的价值。我们试过这样的

html的

 <ion-nav-buttons side="right">
        <button class="button button-icon" ng-click="ApplySelectelements(result)">Apply</button>
 </ion-nav-buttons>

<ion-item ng-repeat="Cate in Categorys | filter:searchQuery">
        <ion-radio ng-model="result"   ng-value="'{{Cate}}'">{{Cate}}</ion-radio>
    </ion-item>

JS

$scope.ApplySelectelements = function (result){
            alert('Select Categry is Apply ' +result);
         }

警报我们得到了Result is Undefined 请指导我们。我的代码有什么问题

1 个答案:

答案 0 :(得分:0)

试试此代码

    <ion-nav-buttons side="right">
       <button class="button button-icon" ng-click="ApplySelectelements(result)">Apply</button>
    </ion-nav-buttons>

    <ion-item >
        <ion-radio name="myRadios" ng-repeat="Cate in Categorys" ng-model="result" ng-value="Cate">{{Cate}}</ion-radio>
    </ion-item>