Likely this is because I'm using a newer version of Angular, but I ran into an issue where the animations stopped after each element had been updated once up and once down. Here is the code in the book:
$animate.addClass($element, 'change-' + direction, function() {
$animate.removeClass($element, 'change-' + direction);
});
I think the code is attempting to remove the class before the animation is complete and causing a problem.To solve this, I modified the above code slightly to make sure that the directive only continues once the animation promise from the addClass function has been returned:
$animate.addClass($element, 'change-' + direction).then( function() {
$animate.removeClass($element, 'change-' + direction);
});
Reference
Likely this is because I'm using a newer version of Angular, but I ran into an issue where the animations stopped after each element had been updated once up and once down. Here is the code in the book:
I think the code is attempting to remove the class before the animation is complete and causing a problem.To solve this, I modified the above code slightly to make sure that the directive only continues once the animation promise from the addClass function has been returned:
Reference