vasyabigi / angular-slick

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

Move "Slick" events binding before initialization. #101

Open amrfaisal opened 9 years ago

amrfaisal commented 9 years ago

Based on this: https://github.com/kenwheeler/slick/issues/1005. You should move all events binding before initializing "Slick" plugin it-self. Specially "onInit" event.

xml commented 9 years ago

I think angular-slick has gone inactive, judging by the huge backlog of PRs. But you can fix this problem by simply making a copy of the library, and moving the two event-handlers. Inside of the 'intializeSlick' function, find slider.on('init', ... and slider.on('afterChange', ..., and move them up above the call to slider.slick({...}).

idreeshaddad commented 9 years ago

That worked for me. +1

I've sent @vasyabigi 24 days ago; asking him if he is not interested in maintaining the repo, maybe he can assign it to somebody who is welling. He did not respond, I hope that he is doing well.

rfaill commented 8 years ago

There's a second bug in the on-init handler, too - the first "if" statement needs to check scope.onInit.

And +1 for moving the handler above the slick initialization to get on-init working.