2016-07-27 3 views
1
<item id="item-1" class="item ng-scope" ng-repeat="incident in $ctrl.allIncidents track by incident.dg_guid"><div role="tablist" class="panel-group" ng-transclude=""> 
    <div class="panel ng-scope ng-isolate-scope panel-default panel-open" ng-class="panelClass || 'panel-default'" is-open="$ctrl.isExpanded" style=""> 

    <div id="accordiongroup-1970-6335-panel" aria-labelledby="accordiongroup-1970-6335-tab" aria-hidden="false" role="tabpanel" class="panel-collapse in collapse" uib-collapse=" 
    <!-- ngIf: $ctrl.showTextArea --> 
    <div> 

      <!-- ngRepeat: event in $ctrl.timeline.filterBy track by $index --><div class="incident-details__description-text flex-space-between ng-scope" ng-repeat="event in $ctrl.timeline.filterBy track by $index"> 
       <div> 
        <!-- ngRepeat: time in event.date track by $index --><div class="timeline__time__container ng-scope timeline__container-first" ng-repeat="time in event.date track by $index" ng-class="{'timeline__container-first': $first}"> 
         <span class="timeline__time ng-binding">8:39 PM</span><br> 
        </div><!-- end ngRepeat: time in event.date track by $index --><div class="timeline__time__container ng-scope" ng-repeat="time in event.date track by $index" ng-class="{'timeline__container-first': $first}"> 
         <span class="timeline__time ng-binding">07/26/16</span><br> 
        </div><!-- end ngRepeat: time in event.date track by $index --> 
       </div>     
       </div> 
      </div><!-- end ngRepeat: event in $ctrl.timeline.filterBy track by $index --><div class="incident-details__description-text flex-space-between ng-scope" ng-repeat="event in $ctrl.timeline.filterBy track by $index"> 
       <div> 
        <!-- ngRepeat: time in event.date track by $index --><div class="timeline__time__container ng-scope timeline__container-first" ng-repeat="time in event.date track by $index" ng-class="{'timeline__container-first': $first}"> 
         <span class="timeline__time ng-binding">7:08 PM</span><br> 
        </div><!-- end ngRepeat: time in event.date track by $index --><div class="timeline__time__container ng-scope" ng-repeat="time in event.date track by $index" ng-class="{'timeline__container-first': $first}"> 
         <span class="timeline__time ng-binding">07/25/16</span><br> 
        </div><!-- end ngRepeat: time in event.date track by $index --> 
       </div> 

Я пытаюсь получить тайминги timeline__timeкак получить все элементы повторителя под повторителя

this.IncList = element.all(by.repeater('incident in $ctrl.allIncidents track by incident.dg_guid')); 
this.FirtstIncTimeLine = this.IncList.get(0).element.all(by.repeater('event in $ctrl.timeline.filterBy track by $index')); 
this.FirtstIncTopTimeLine = this.FirtstIncTimeLine.first(); 
this.FirtstIncTopTimeLineTime = this.FirtstIncTopTimeLine.element.all(by.css('span.timeline__time')); 

Я получаю следующее сообщение об ошибке:

Error: TypeError: this.IncList.get(...).element.all is not a function

Как я могу получить все элементы ретранслятора под повторителем?

ответ

3

Это общая проблема в транспортир, вы делаете цепное неверно заменить:

this.IncList.get(0).element.all(by.repeater('event in $ctrl.timeline.filterBy track by $index')); 

с:

this.IncList.get(0).all(by.repeater('event in $ctrl.timeline.filterBy track by $index')); 

FYI, если интересно, я currently working on making these kind of problems caught by static code analysis and ESLint.


Как примечание стороны, не использовать «след» внутри повторителя локатора:

this.IncList.get(0).all(by.repeater('event in $ctrl.timeline.filterBy')); 

Я уже реализован the ESLint rule предупредить об этом.

+0

Благодаря @alecxe это помогло. – ssharma