UNPKG

angular-animate-change

Version:
19 lines (17 loc) 482 B
'use strict'; module.exports = function ($animate) { return { restrict: 'EA', link: function (scope, element, attributes) { scope.$watch(attributes.animateChange, function (newVal, oldVal) { if (newVal !== oldVal) { $animate.addClass(element, attributes.changeClass) .then(function () { element.removeClass(attributes.changeClass); }); } }); } }; }; module.exports.$inject = ['$animate'];