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

ui bootstrap carousel animation angular 1.2.* issues #1273

Closed
@autumn01

Description

@autumn01

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>

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions