vasyabigi / angular-slick

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

initialSlide is numeric and as such it should be treated with parseInt() #85

Open quentinburley opened 9 years ago

quentinburley commented 9 years ago

even though the current handling of initialSlide partially works: "initialSlide: scope.initialSlide || 0," it really ought to be treated with parseInt() to force it into a numeric type, as kenwheeler slick.js expects it to be a numeric type and not a string. for example in: https://github.com/kenwheeler/slick/blob/1.5.2/slick/slick.js:399 ^^^ (note that here the '+' operator is clearly arithmetic and not a string concatenator).

I suggest

as is currently the practice for other params that are to be treated as numeric.

quentinburley commented 9 years ago

proposed fix: https://github.com/vasyabigi/angular-slick/pull/86