Angularjs exclude certain elements from animations

I use ngAnimate in some places, but it captures animations for all elements of my ng class. I already had significant animation code written for different elements, for which I do not need ngAnimate. Their adding classes really seem to mess things up. In any case, to exclude these elements?

Here is the element I'm trying to exclude:

<div ng-class="myclass"></div> 

ngAnimate adds classes like

 $scope.myclass = 'move' <div class="move-add" ng-class="myclass"></div> 
0
angularjs angularjs-animation
May 27 '14 at 1:08
source share
1 answer

I was helped by jaawerth on IRC. He directed me to this link:

https://github.com/angular/angular.js/issues/5172

and advised me to write this directive:

 .directive('noAnimate', ['$animate', function($animate) { return { restrict: 'A', link: function(scope, element, attrs) { $animate.enabled(false, element) scope.$watch(function () { $animate.enabled(false, element) }) } }; } ]) 

What solved the problem.

+1
May 27 '14 at 3:05
source share



All Articles