Skip to content
This repository has been archived by the owner on Apr 12, 2024. It is now read-only.

Commit

Permalink
fix($animate): applyStyles from options on leave
Browse files Browse the repository at this point in the history
Closes #10068
  • Loading branch information
PatrickJS authored and petebacondarwin committed Mar 4, 2015
1 parent caa0b9d commit 4374f89
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
1 change: 1 addition & 0 deletions src/ng/animate.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
},
Expand Down
7 changes: 4 additions & 3 deletions test/ng/animateSpec.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 4374f89

Please sign in to comment.