vasyabigi / angular-slick

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

Attribute values are not propagated to Slick properly. #91

Open tomasszabo opened 9 years ago

tomasszabo commented 9 years ago

For example if I define:

<slick data-initial-slide="{{getStartingSlide()}}">
    ...
</slick>

Then then initial slide is displayed correctly (as expected), but the navigation with arrows breaks (i.e. after Slick is displayed, then pressing next arrow skips several slides and breaks the navigation).

In this Slick directive, the scope variables are defined with '@' and such scope variables needs to be evaluated in link function with attr.$observe() function (see explanation here).

If I change the scope variable definition ind directive from '@' to '=' then Slick is behaving normally (no slides skipping when navigating with arrows), but I'm not sure if using '=' in scope variable definition is optimal.