M
M
Maxim Ivanov2016-10-20 14:44:13
Angular
Maxim Ivanov, 2016-10-20 14:44:13

How to call directives in ng-repeat?

Component

<div ng-class="{'hide': ($ctrl.data.length < 1) ? 1 : 0 }" class="outputEntityList" collapsibleinit>

  <ul class="collapsible proccesscollaps" data-collapsible="accordion" ng-repeat="entity in $ctrl.data" >
    <li>
      <div class="collapsible-header active">
        <i class="material-icons">arrow_drop_down</i> {{ entity.title }}
      </div>

      <div class="collapsible-body">
                                     text
                         </div>
    </li>
  </ul>

</div>

collapsibleinit is a directive that calls the jQuery plugin $('.collapsible').collapsible();
But the fact is that, as I understand it, the collapsibleinit directive fires immediately when the page is loaded, and when the $ctrl.data collection already changes (from 0 to n values), then, of course, the directive does not work again
. How can I implement or fix this?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question