I think the best way to do this is to use $animateProvider.classNameFilter , which will allow you to filter items for animation, or in this case not for animation. We will do something like:
$animateProvider.classNameFilter(/^((?!(fa-spinner)).)*$/); //$animateProvider.classNameFilter(/^((?!(fa-spinner|class2|class3)).)*$/);
Demo:
http://plnkr.co/edit/lbqviQ87MQoZWeXplax1?p=preview
Angular docs state:
Sets and / or returns the regular expression of the CSS class, which is checked when performing the animation. When loading, the value of classNameFilter is not set at all and therefore will allow $ aimate to try to perform animation on any element. When setting the NameFilter class, animations will be performed only for elements that successfully match the filter expression. This, in turn, can improve performance for low-power devices, as well as applications containing many structural operations.
As another answer for a comment with the no-animate you can write the ng-show directive, which will work with a higher priority and disable animation. We will only do this if the element has a fa-spinner class.
problemApp.directive('ngShow', function($compile, $animate) { return { priority: 1000, link: function(scope, element, attrs) { if (element.hasClass('fa-spinner')) { // we could add no-animate and $compile per // http://stackoverflow.com/questions/23879654/angularjs-exclude-certain-elements-from-animations?rq=1 // or we can just include that no-animate directive code here $animate.enabled(false, element) scope.$watch(function() { $animate.enabled(false, element) }) } } } });
Demo: http://plnkr.co/edit/BYrhEompZAF5RKxU7ifJ?p=preview
Finally, and similarly to the above, we can use the no-animate directive if we want to make it more modular. In this case, I call the faSpin directive, which you could do in the answer above. This is essentially the same, we keep the directive from the SO answer mentioned in the comment of the above code set. If you are worried about problems with fa-spin animation, naming them that way, this works well, but if you have other problems with ng-show animation, you want to name it ngShow and add it to the if clause.
problemApp.directive('noAnimate', ['$animate', function($animate) { return { restrict: 'A', link: function(scope, element, attrs) { $animate.enabled(false, element) scope.$watch(function() { $animate.enabled(false, element) }) } }; } ]) problemApp.directive('faSpin', function($compile, $animate) { return { priority: 1000, link: function(scope, element, attrs) { if (element.hasClass('fa-spinner')) { element.attr('no-animate', true); $compile(element)(scope); } } } });
Demo: http://plnkr.co/edit/P3R74mUR27QUyxMFcyf4?p=preview