vasyabigi / angular-slick

Angular directive for slick-carousel
http://vasyabigi.github.io/angular-slick/
MIT License
500 stars 237 forks source link

Lazy loading images with binding #57

Open rodrigoreis22 opened 9 years ago

rodrigoreis22 commented 9 years ago

How can I use the lazy loading feature (adding the data-lazy attribute) with a binding:

<slick lazy-load='ondemand' slides-to-show=3 slides-to-scroll=1 class="slider lazy">
    <div ng-repeat="video in popularVideos"><div class="image"><img data-lazy="{{video.thumbnails.regular200x110.url}}"/></div></div>
</slick>

The above code doesn't work.

rodrigoreis22 commented 9 years ago

Got it.. I forgot the data attribute:

<slick lazy-load='ondemand' slides-to-show=5 slides-to-scroll=3 slides-to-scroll=1 init-onload=true data="popularVideos" class="slider lazy">
    <div ng-repeat="video in popularVideos"><div class="image"><img data-lazy="{{video.thumbnails.regular200x110.url}}"/></div></div>
</slick>