bootstrap icon indicating copy to clipboard operation
bootstrap copied to clipboard

ui bootstrap carousel animation angular 1.2.* issues

Open autumn01 opened this issue 13 years ago • 61 comments

the new implementation of ng-animate seems to be interfering with the animation for the carousel slider directive.

<div ng-class="{
    'active': leaving || (active && !entering),
    'prev': (next || active) && direction=='prev',
    'next': (next || active) && direction=='next',
    'right': direction=='prev',
    'left': direction=='next'
  }" class="item ng-scope ng-isolate-scope ng-animate ng-enter ng-animate-start ng-animate-active ng-enter-active next left" ng-transclude="" ng-repeat="slide in slides" active="slide.active" style="-webkit-transition-property: left, clip; -webkit-transition-duration: 0.6s, 0.6s; ">
...
</div>

note the extra classes. On my end this is causing flickering and

here is a coded example to explain the result http://jsfiddle.net/XxPzW/

I am trying to look into weather there is a way to disable ng-animate for a singe directive, I haven't found anything yet.

EDIT: This account is no longer used i now go by @iamlothian.

EDIT: http://plnkr.co/edit/UWDcnJ2PGZd474D5SuoS?p=preview (work around)

.directive('setNgAnimate', ['$animate', function ($animate) {
    return {
        link: function ($scope, $element, $attrs) {
            $scope.$watch( function() {
                return $scope.$eval($attrs.setNgAnimate, $scope);
            }, function(valnew, valold){
                console.log('Directive animation Enabled: ' + valnew);
                $animate.enabled(!!valnew, $element);
            });
        }
    };
}]);

Used like this:

<div ng-controller="SomeController" set-ng-animate="false">
    <carousel interval="myInterval">
        <slide ng-repeat="slideCollection in groupedSlides" active="slide.active">
            <div>
                <img ng-src="{{slideCollection.image1.image}}" style="margin:auto;">
                <img ng-src="{{slideCollection.image2.image}}" style="margin:auto;">
            </div>
        </slide>
    </carousel>
</div>

autumn01 avatar Nov 19 '13 04:11 autumn01

Still have this problem in "angular": "1.3.2" and "bootstrap-sass-official": "~3.1.1"

wintlu avatar Dec 25 '14 10:12 wintlu