Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

Make $animateCss available in Angular #12509

Closed
wesleycho opened this issue Aug 6, 2015 · 3 comments
Closed

Make $animateCss available in Angular #12509

wesleycho opened this issue Aug 6, 2015 · 3 comments

Comments

@wesleycho
Copy link
Contributor

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
Copy link
Contributor

matsko commented Aug 6, 2015

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.

@matsko matsko self-assigned this Aug 6, 2015
@wesleycho
Copy link
Contributor Author

Yup, exactly that - the detection otherwise is unideal.

@matsko
Copy link
Contributor

matsko commented Aug 6, 2015

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

@Narretz Narretz added this to the 1.4.x milestone Aug 6, 2015
matsko added a commit to matsko/angular.js that referenced this issue Aug 12, 2015
A core version of `$animateCss` can now be injected when
ngAnimate is not present. This core version doesn't trigger any
animations in any way. All that it does is apply the provided from
and/or to styles as well as the addClass and removeClass values.

The motivation for this feature is to allow for directives to activate
animations automatically when ngAnimate is included without the need to
use `$animate`.

Closes angular#12509
@matsko matsko closed this as completed in 39b634e Aug 13, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants