2

I'm new to this AngularJS thing, and I want to create a carousel with Angular UI Bootstrap. Is it possible to go to a specific slide by clicking an button?

http://plnkr.co/edit/X0Mr1sPUr5Je0tfkzgjy

Many thanks!

1

1 Answer 1

6

Sure. Each slide can have a bindable active property. You can use it to mark any slide as active. Here is an example in a plunk: http://plnkr.co/edit/hvfaMFz4q1AlbOpuOwFv?p=preview

Sign up to request clarification or add additional context in comments.

3 Comments

i thought i needed to set that property of the currently active slide to false, and this created a flicker. This solution is simple, thank you very much
@pkozlowski.opensource i checked in plunker , passing array no. 3 gives error ,its not working plnkr.co/edit/F8ixwSIWsgbqLs7WCVuf?p=preview
This doesn't seem to work if slides are static. Controller throws "$scope.slide is undefined"

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.