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

fix($animate): applyStyles from options on leave #10068

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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