如何使用角度ng-repeat创建嵌套轮播

时间:2015-10-26 12:23:20

标签: angularjs

我想用ng-repeat创建一个嵌套的旋转木马,但是儿童旋转木马确实没有正常工作.. 我无法将轮播的第一项设置为有效

 <div data-wrap="false" data-interval="false" class="carousel col-xs-12" id="Carousel" style="padding:0px">
                  <div class="carousel-inner">
                    <div class="item  "  ng-class="{'active':  !$index}" ng-repeat="question in questions | filter:{visible: true}"  ng-if="$index< questions.questionCount">
                      <div class="row"  style="background-color:#00A693; color:#fff; font-size:20px; padding:20px; border-radius:5px; margin-right:-15px">
                        <div class="col-md-12" >
                          <p>Question: {{$index+1}} / {{questions.questionCount }} &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <spanclass="pull-center">Marks:&nbsp;<span ng-bind="question.mark"></span></span><span class="pull-right"><span class="glyphicon glyphicon-time"></span>:<span class="hidden-xxs"></span> <span class="time-duration"><strong></strong> <small style="color:#fff">Minutes</small></span> </span> </p>
                        </div>
                      </div>
                      <div style="float:left; width:100%;">
                        <div class="col-sm-offset-1 col-sm-10 col-xs-offset-0 col-xs-12">
                          <h3 class="question" style="font-size:18px; background-color:#CCCCCC; border-radius:10px; padding:40px" >
                            <p  style="color:#000000" mathjax-bind="question.question"></p>
                          </h3>


                <div ng-if="question.sub_question==1">  


                  <div class="carousel" id="carousel1" data-wrap="false" data-interval="false">
                    <div class="carousel-inner">


                      <div class="item"  ng-repeat="quests in question.sub_question_list" ng-class="{'active': {{$index}}==0}" id="item{{$index}}">
                        <h3>Step: {{$index+1}}</h3>
                        <div class="col-sm-offset-1 col-sm-10 col-xs-offset-0 col-xs-12">
                          <h3 class="sub_question" style="font-size:18px;" >
                            <p  style="color:#000000" mathjax-bind="quests.quest"></p>
                          </h3>

0 个答案:

没有答案