angular-flexslider icon indicating copy to clipboard operation
angular-flexslider copied to clipboard

set start-at dynamically

Open rawzz opened this issue 9 years ago • 5 comments

When i set start-at value from a scope var the binding doesn't occur.

rawzz avatar Jun 10 '15 16:06 rawzz

That should occur. could you provide a code example please?

thenikso avatar Jul 07 '15 08:07 thenikso

$scope.currentSlide = 5;

< flex-slider slide="slide in slides track by $index" start-at="{{ currentSlide }}"> < li> < img ng-src="{{slide}}"> < /li> < /flex-slider>

rawzz avatar Jul 07 '15 08:07 rawzz

same problem, how could you fix this?

rs-rayalab avatar Jul 13 '15 22:07 rs-rayalab

same problem, any solution?

arjundas avatar Aug 10 '15 10:08 arjundas

I'm pretty new at angular, so I don't understand why this is happening, but I've found a workaround. Do not include the {{}} around your variable and it will parse and evaluate as you expect:

$scope.currentSlide = 5;

< flex-slider slide="slide in slides track by $index" start-at="currentSlide"> < li> < img ng-src="{{slide}}"> < /li> < /flex-slider>

This is the code in angular-flexslider.js that is breaking for me: if (attrKey === 'startAt') { options[attrKey] = $parse(attrVal)($scope); continue; }

jrothenberger avatar Sep 14 '15 14:09 jrothenberger