This repository was archived by the owner on Apr 12, 2024. It is now read-only.
This repository was archived by the owner on Apr 12, 2024. It is now read-only.
ngAnimate: lookUpAnimations function breaks if CSS class is an Array.prototype function name. #11619
Closed
Description
Hello, I'm having a problem with the lookUpAnimations function in src/ngAnimate/animateJs.js. It iterates over the CSS classes of the element and gets the registered animation provider:
// Extract from src/ngAnimate/animateJs.js#L241
var klass = classes[i],
animationFactory = $animateProvider.$$registeredAnimations[klass];
if (animationFactory && !flagMap[klass]) {
matches.push($injector.get(animationFactory));
flagMap[klass] = true;
}
My element has a CSS class named "filter" so, when doing:
animationFactory = $animateProvider.$$registeredAnimations[klass];
the animationFactory
variable ends up being a reference to Array.prototype.filter
(because $$registeredAnimations
is of type Array). After that, I got an unknown provider exception because it calls $injector.get()
with the filter function.
I already changed the CSS class, but shouldn't $$registeredAnimations be just a plain object (like Object.create(null)) instead of an Array if it's going to be used that way?
Thoughts?
Metadata
Metadata
Assignees
Labels
No labels