vasyabigi / angular-slick

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

Using boolean('false') always returns true #163

Closed draehal closed 7 years ago

draehal commented 7 years ago

In Slick.js, you use Boolean(scope.arrows) with arrows declared as "@" on the scope. This produces a boolean literal of 'true' even when the string "false" is given as parameter. I would suggest using a custom parser, or if you expect a modern browser JSON.parse(scope.arrows).

The effect is that any configuration entry on the conf object that uses a Boolean will always be true

Javascript Boolean docs. https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean

Here is a plinker I created that clearly demonstrates the issue.

http://embed.plnkr.co/pd4oBC/

draehal commented 7 years ago

Sorry, wrong place