vasyabigi / angular-slick

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

Broken: undefined method sl.slideHandler(currentIndex) #141

Open dooziiinc opened 8 years ago

dooziiinc commented 8 years ago

I'm having a problem that seems to be located at line 124:

 if (currentIndex != null) {
               ** return sl.slideHandler(currentIndex);**
              }

is returned undefined and I'm receiving a message that sl.slideHandler(currentIndex) is not a function. I'm debugging and sure enough, the function is showing as undefined. I am able to see swipeHandler, clickHandler, etc functions, but not the slideHandler.

I'm trying to bind the current-index to a client-side model so that when my data loads, the slider will display a specific item from the list. So far, I have been unable to get the initialSlide to initialize or update correctly. When my page loads, I get data and init the slick directive which, I would think, would allow the initial slide to bind correctly.

I have the latest version of slick-carousel. and using this directive with it. Any ideas or thoughts?

Lospepes commented 8 years ago

I have the same issue !

RoyXun commented 8 years ago

dooziiinc commented on 25 Mar

You can modify the code in line 119 of angular-slick/dist/slick.js like this:

   slider.on('init', function (evt, sl) {
    //...
  });

Besides, you should move all events binding before initialization (see #101)

taniket15 commented 5 years ago

Downgrading slick-carousel to v1.3.15 seems to fix this issue. I have also moved all event binds before initialization (see #101)