diff --git a/src/ng/animate.js b/src/ng/animate.js index 752ed0e15f6f..f268773ef2af 100644 --- a/src/ng/animate.js +++ b/src/ng/animate.js @@ -210,6 +210,7 @@ var $AnimateProvider = ['$provide', function($provide) { * @return {Promise} the animation callback promise */ leave: function(element, options) { + applyStyles(element, options); element.remove(); return asyncPromise(); }, diff --git a/test/ng/animateSpec.js b/test/ng/animateSpec.js index 0c848ad1becd..ed7d17d3b98a 100644 --- a/test/ng/animateSpec.js +++ b/test/ng/animateSpec.js @@ -148,10 +148,11 @@ describe("$animate", function() { $rootScope.$digest(); assertColor('blue'); - $animate.leave(element, 'off', { - to: { color: 'blue' } + $animate.leave(element, { + to: { color: 'yellow' } }); - assertColor('blue'); //nothing should happen the element is gone anyway + $rootScope.$digest(); + assertColor('yellow'); function assertColor(color) { expect(element[0].style.color).toBe(color);