fix($animate): applyStyles from options on leave

Closes #10068
This commit is contained in:
gdi2290
2014-11-17 19:18:24 -08:00
committed by Peter Bacon Darwin
parent e721169738
commit ebd84e8008
2 changed files with 5 additions and 3 deletions
+1
View File
@@ -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();
},
+4 -3
View File
@@ -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);