With angular, I'm creating a slide show dynamically with 50+ slides in it. Now this effects the browser and slows a lot of things down. So I added an ng-class
the slides to evaluate their index.
ng-class="currentSlide >= (currentSlide-1) && currentSlide <= (currentSlide+1) ? 'visible' : 'hidden'"
currentSlide
is a variable that will return the current index of the slide when ever the slide chagnes, so it will always update.
I know currentSlide
works, whats wrong is my ng-class
expression.
Is it possible to do the math, even if it is as simple as + 1
, inside of the expression?
Or should I more this out to variables in my controller and get their value there?