Skip to content
This repository has been archived by the owner on May 29, 2019. It is now read-only.

Carousel not able to set active slide after assining new slides #2235

Closed
kimvanhees opened this issue May 21, 2014 · 6 comments
Closed

Carousel not able to set active slide after assining new slides #2235

kimvanhees opened this issue May 21, 2014 · 6 comments

Comments

@kimvanhees
Copy link

I have a simple Carousel example. In this example on Plnkr I change the slides in my application. When I set the active slide after I change slides it goes to that slide and then slides out into oblivion or it goes to the first slide instead.

http://plnkr.co/edit/PJg9U4HZ1k5aSTSvbl3k?p=preview

angular.module('plunker', ['ui.bootstrap', 'ngTouch']);
function CarouselDemoCtrl($scope) {
    $scope.genderPerson = "men";
    $scope.myInterval = -1;
    $scope.slides = [];

    $scope.$watch("genderPerson", function( newValue, oldValue ) {
        $scope.MakeSlides();
    });

    $scope.MakeSlides = function() {
        var newSlides = [];
        for ( var i = 0; i < 10; i++ ) {
            newSlides[i] = { image: 'http://api.randomuser.me/portraits/' + $scope.genderPerson + '/' + i + '.jpg' };
         }
         $scope.slides = newSlides;
         if ( $scope.slides[6] ) {
             $scope.slides[6].active=true;
         }
    }
}
@chrisirhc
Copy link
Contributor

chrisirhc added a commit to chrisirhc/angular-ui-bootstrap that referenced this issue Sep 15, 2014
chrisirhc added a commit to chrisirhc/angular-ui-bootstrap that referenced this issue Sep 15, 2014
chrisirhc added a commit to chrisirhc/angular-ui-bootstrap that referenced this issue Sep 15, 2014
@robertochingon
Copy link

Hi, I have same issue but I´m using ui-bootstrap0.6.0 (dependencies with angularJS1.0.7 and Bootstrap 2.3.2). Is it fixed in this version also? I´m trying to do it, but it doesn´t work for me.

chrisirhc added a commit to chrisirhc/angular-ui-bootstrap that referenced this issue Mar 16, 2015
chrisirhc added a commit to chrisirhc/angular-ui-bootstrap that referenced this issue Mar 17, 2015
@karianna karianna added this to the 0.13.0 milestone Mar 19, 2015
@stuartm
Copy link

stuartm commented Sep 9, 2015

I'm seeing the same issue with the latest release 0.13.2, if I update the change list used by the carousel then no slides are 'active' and the carousel disappears.

@shabetya
Copy link

shabetya commented Oct 6, 2015

0.13.4 version also has that bug again! if redefine slides, active class is not set

@dotcom9
Copy link

dotcom9 commented Mar 22, 2016

Is there a workaround for this bug in 0.13.4? Unfortunately, I can't upgrade due to project constraints.

@icfantv
Copy link
Contributor

icfantv commented Mar 22, 2016

@dotcom9 you could try back porting the fix depending on how invasive it is. I understand all too well the pain of being forced to remain on an old version.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

8 participants