Skip to content

AfterChange event wasn't triggered #169

Open
mamzellejuu wants to merge 2 commits intovasyl-stanislavchuk:masterfrom
nurun:feature/afterchange-fix
Open

AfterChange event wasn't triggered #169
mamzellejuu wants to merge 2 commits intovasyl-stanislavchuk:masterfrom
nurun:feature/afterchange-fix

Conversation

@mamzellejuu
Copy link
Copy Markdown

The script never enter in

slider.on('afterChange', function (event, slick, currentSlide, nextSlide) {
       if (scope.onAfterChange) {
                scope.onAfterChange();
       }
       if (currentIndex != null) {
           return scope.$apply(function () {
               currentIndex = currentSlide;
               return scope.currentIndex = currentSlide;
           });
     }
});

The listener should be created before the slick plugin initialization. This will make sure that the event is not run before the listener created

@Disorrder
Copy link
Copy Markdown

isn't it fixed in version 1.6? Well, angular-slick uses

"dependencies": {
    "angular": "~1.3.0",
    "slick-carousel": "~1.4.1"
  },

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants