angular / angular.js

AngularJS - HTML enhanced for web apps!
https://angularjs.org
MIT License
58.85k stars 27.52k forks source link

$animateCss doesn't notify progress. #12691

Closed wawyed closed 6 years ago

wawyed commented 9 years ago

According to documentation:

$animate.on

Sets up an event listener to fire whenever the animation event (enter, leave, move, etc...) has fired on the given element or among any of its children.

Would it be possible to notify $animateCss phases as well?

matsko commented 9 years ago

Are you trying to use $animateCss programmatically? Why not just tap into the callback promise?

$animateCss(element, options).start().then(callback);
wawyed commented 9 years ago

My original issue was that I was using $animate.on to listen for an addClass event on an element to defer an action after the animation was finished (focusing another element). It was working fine with $animate.addClass but the library that added that class to the element (angular ui bootstrap) changed the approach by using $animateCss({addClass: 'in'}).

This is how the code looks like on the directive:

https://github.com/angular-ui/bootstrap/blob/master/src/modal/modal.js#L209

I managed to get around it by submitting a PR to ui.bootstrap to defer the focus of the modal after the animation has finished.

Although this doesn't change the fact that it would make sense for $animateCss to trigger those events according to what the docs say about $animate.on. What do you think?

Narretz commented 8 years ago

I think that's definitely something we could consider for 1.6

petebacondarwin commented 6 years ago

This is not going to make it, sorry.