ksachdeva / angular-swiper

Angular directive for nolimits4web/Swiper
Apache License 2.0
197 stars 94 forks source link

Bug: Can't swip before I resize the browser window #45

Closed Wallfacer005CN closed 8 years ago

Wallfacer005CN commented 8 years ago

The slide can't swip before I resize the browser window. Once I resize the brwser window, then it can work very well. Why?

Wallfacer005CN commented 8 years ago

I have fixed it by ng-if.

<ks-swiper-container show-nav-buttons="true" ng-if="items">

Rex90 commented 8 years ago

Is this because you used ng-repeat on items?

normtronics commented 8 years ago

Im using ng-repeat and running into this issue. How can I fix it?

brh55 commented 8 years ago

41 <- reference for help.

Explanation: This is because the swiper is started before all the slides are created through the angular ng-repeat directive. Thus a .update is needed to recalculate these properties, and wrapping a $timeout will force this method to be invoked at the end of the digest cycle 👍 .