AngularJS

Disable Angular Animation on Certain Element

To be used like this:

<div disable-animation></div>


Directive:

angular.module('demo').directive('disableAnimation', function ($animate) {
  return {
    restrict: 'A',
    link: function($scope, $element){
      $animate.enabled(false, $element);
    }
  };
});

However. After Version 1.4 it’s $animate.enabled($element, false) instead of the other way round. Also as of 1.3.17 doesn’t work with ng-if.

Standard