ui-carousel icon indicating copy to clipboard operation
ui-carousel copied to clipboard

Using ng-if causes duplicates in the number of items

Open zeiadhabbab opened this issue 7 years ago • 1 comments

When adding ng-if on container div for ui-carousel, each time the div is displayed , ui-carousel will multiply the items inside of it.

this is the example of the code:

<div  ng-if="Dashboard.flag">
    <ui-carousel
        slides="Dashboard.slides"
        slides-to-show="3"
        slides-to-scroll="1"
        initial-slide="1"
        dots="true">
      <carousel-item>
        <h3>{{ item + 1 }}</h3>
      </carousel-item>
    </ui-carousel>
  </div>
  <button ng-click="Dashboard.showhide()">Click me</button>

any idea how to fix this?

this is the firs time: wpch4uhz1xlvwaaaabjru5erkjggg

this is after hiding and showing div: dxacl8nr52wbaaaaaelftksuqmcc

zeiadhabbab avatar Apr 05 '17 09:04 zeiadhabbab

@zeiadhabbab Fixed on e3696ca

mihnsen avatar May 07 '17 23:05 mihnsen