angular / angular.js

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

Make $animateCss available in Angular #12509

Closed wesleycho closed 9 years ago

wesleycho commented 9 years ago

For library maintainers that allow users to opt-in to animations, there is a gap in support - currently $animateCss is only available in ngAnimate. It would be useful to have a matching API in Angular itself with a $animateCss service, similar to how $animate is handled. The only way to detect if the user has $animateCss is to do a try-catch with fetching via $injector and swallow the exception, and fall back to $animate usage in that case.

matsko commented 9 years ago

So you're saying to have a shell service in core for $animateCss? It only just sets classes and styles in the same way that the actual $animateCss service ngAnimate does just without any triggered animations.

wesleycho commented 9 years ago

Yup, exactly that - the detection otherwise is unideal.

matsko commented 9 years ago

Works for me. This is a good use case. I'll get to work on it.