Open supermarioim opened 7 years ago
@supermarioim https://github.com/devmark/angular-slick-carousel#faq
Q: After change data, could i keep the current slide index? A: For this directive, this will destroy and init slick when updating data. You could get current index by event. example:
$scope.currentIndex = 0;
$scope.slickConfig = {
event: {
afterChange: function (event, slick, currentSlide, nextSlide) {
$scope.currentIndex = currentSlide; // save current index each time
}
init: function (event, slick) {
slick.slickGoTo($scope.currentIndex); // slide to correct index when init
}
}
};
what's your problem with that?
As I can see there is method slickCurrentSlide in original slick methods, but it's not ported...