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

ng-animate addClass, classNameFilter and svg element does not work together #14508

Closed
artaommahe opened this issue Apr 25, 2016 · 7 comments · Fixed by #14529
Closed

ng-animate addClass, classNameFilter and svg element does not work together #14508

artaommahe opened this issue Apr 25, 2016 · 7 comments · Fixed by #14529

Comments

@artaommahe
Copy link

artaommahe commented Apr 25, 2016

Plunk - http://plnkr.co/edit/Wk0yHL
Element rotates on button click via adding 'fsp-refresh-icon--rotated' and on animation end this class must be removed. If you uncomment

$animateProvider.classNameFilter(/use-animate/);

then animation will not work - $animate.addClass() promises resolves instantly after start.
With div element everything works well(.styled commented out div in template near svg, uncomment it and comment out svg)

@Narretz
Copy link
Contributor

Narretz commented Apr 26, 2016

I don't see the problem. The classNameFilter defines a regex that is matched against an element's class. If there's a match, the element is animated, if not, it's not animated. So in your example you have to give your element the class use-animate and it'll work.

@artaommahe
Copy link
Author

artaommahe commented Apr 26, 2016

@Narretz in my example there is class for svg element and animation does not work.

<svg id="fsp_refresh_icon" class="use-animate" ...

@Narretz
Copy link
Contributor

Narretz commented Apr 26, 2016

You must have posted the wrong plnkr. There's no svg element in the one you posted.

@artaommahe
Copy link
Author

@Narretz my bad, here is right one http://plnkr.co/edit/Wk0yHL

@artaommahe
Copy link
Author

@Narretz do u review fixed link and this bug? (previous issue with another bug was lost after being closed despite my comments after this...)

@Narretz
Copy link
Contributor

Narretz commented Apr 27, 2016

I'll check it tomorrow

@artaommahe
Copy link
Author

thx

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.