在离子版本1中获取数组值

时间:2017-06-16 14:11:22

标签: javascript angularjs ionic-framework

我正在尝试在ionic.please中创建一个测验应用,请检查以下代码:

<div class="card" ng-repeat="single in quiz track by $index">
                <div class="item item-text-wrap">
                    <h3>
                        <i class="{{single.important==0 ? 'ion-android-star-outline' : 'ion-android-star'}}" ng-click="impQuestion('{{single.question_id}}')" style="color:#F5B120; position: absolute; right: 5px; top: 0px; font-size: 18px;"></i>
                        <strong>{{single.question_title}}</strong></h3>
                    <input type="hidden" ng-model="questions" name="questions[]" value="{{single.question_id}}">
                    <ul>
                        <li ng-repeat="ans in single.answers track by $index"><input ng-model="ans[{{single.question_id}}]" type="radio" name="ans[{{single.question_id}}]" value="{{ans.answer_id}}"> {{ans.answer_title}}</li>
                    </ul>
                </div>
            </div>

如何在控制器中获取(ans和问题)的数组值?

0 个答案:

没有答案