Closed wesleycho closed 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.
Yup, exactly that - the detection otherwise is unideal.
Works for me. This is a good use case. I'll get to work on it.
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.