javascript - slick slider creating last slide empty Angular JS?
652
Can users please explain why they are downvote this question?
Facing a problem in a slick slider that it creating an empty slide at last below is my code that is written in Angular JS. How can I deactivate or remove that empty slide?
<slick dots=false infinite=true speed=300 slides-to-show=3 touch-move=false slides-to-scroll=1 init-onload=true data="city_section">
<div ng-repeat="city_s in city_section" >
<img ng-if="city_s.search_city_image" src="<?php echo UPLOAD_PATH ?>city/{{city_s.search_city_image}}" class="img-responsive">
</div>
</slick>
Answer
Solution:
Usage Using bower to install it. bower install angular-slick-carousel Add jquery, angular, slick-carousel and angular-slick-carousel to your code.
Add the sortable module as a dependency to your application module: slickCarousel
This directive allows you to use the slick-carousel plugin as an angular directive. It can be specified in your HTML as either a attribute or a element.
Attributes & Event settings: optional Object containing any of the slick options. Consult here.
enabled should slick be enabled or not. Default to true. Example below method optional containing slick method. discussed below in detail event optional containing slick event
Enable/disable slick Slick can be easily switched on and off by using enabled settings flag.
Pass it as the value to control attribute. Now, you can call any plugin methods as shown in the example.
Slide data For change slide content, you have to set ng-if to destroy and init it
controller:
https://www.npmjs.com/package/angular-slick-carousel