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

ngAnimate: Set class name filter to include also children elements? #14891

Closed
softzer0 opened this issue Jul 10, 2016 · 4 comments
Closed

ngAnimate: Set class name filter to include also children elements? #14891

softzer0 opened this issue Jul 10, 2016 · 4 comments

Comments

@softzer0
Copy link

softzer0 commented Jul 10, 2016

Here's an example: http://plnkr.co/edit/jQUwh3KsZ1uR3lr3TrLK?p=preview
I want to set classNameFilter setting to apply to the children elements as it applies to the parent which contains class name in filter. So, how to achieve that as I haven't seen such option (so I guess this is a feature request)?
Thanks in advance!

@gkalpak
Copy link
Member

gkalpak commented Jul 11, 2016

That feature could come in handy.
As a work-around, you can specifically enable animations on specific element using a directive: POC

@softzer0
Copy link
Author

softzer0 commented Jul 15, 2016

I see now that this is not quite a good workaround since the directive will apply only to the current/initial children elements but not for the ones added after. I have a problem now with that because I'm using ng-repeat and when I'm doing live addition of new elements to the collection which displays in the template, animation won't be performed on them. Can that also be solved with some workaround, or not? Thanks!

@gkalpak
Copy link
Member

gkalpak commented Jul 15, 2016

@mikisoft, I know - this is just a work-around (and not an efficient one either).
We should have a way to easily (and dynamically) allow animations on specific parts of the page only.

gkalpak added a commit to gkalpak/angular.js that referenced this issue Jul 15, 2016
This commit adds a new `customFilter()` function on `$animateProvider` (similar to
`classNameFilter()`), which can be used to filter animations (i.e. decide whether thay are allowed
or not), based on the return value of a custom filter function.
This allows to easily create arbitrarily complex rules filtering animations, such as allowing
specific events only, or enabling animations on specific subtrees of the DOM.

Fixes angular#14891
gkalpak added a commit to gkalpak/angular.js that referenced this issue Jul 15, 2016
This commit adds a new `customFilter()` function on `$animateProvider` (similar to
`classNameFilter()`), which can be used to filter animations (i.e. decide whether thay are allowed
or not), based on the return value of a custom filter function.
This allows to easily create arbitrarily complex rules for filtering animations, such as allowing
specific events only, or enabling animations on specific subtrees of the DOM etc.

Fixes angular#14891
@softzer0
Copy link
Author

softzer0 commented Jul 15, 2016

Okay, one more thing and I won't annoy you anymore: Can you post here working example using that new feature (you could again modify mine)? After that, this issue can be closed.
And of course, thank you for doing the great job!

@petebacondarwin petebacondarwin modified the milestones: Backlog, Backlog2 Oct 17, 2016
gkalpak added a commit to gkalpak/angular.js that referenced this issue Jan 5, 2017
This commit adds a new `customFilter()` function on `$animateProvider` (similar
to `classNameFilter()`), which can be used to filter animations (i.e. decide
whether they are allowed or not), based on the return value of a custom filter
function.
This allows to easily create arbitrarily complex rules for filtering animations,
such as allowing specific events only, or enabling animations on specific
subtrees of the DOM, etc.

Fixes angular#14891
gkalpak added a commit to gkalpak/angular.js that referenced this issue Jan 12, 2017
This commit adds a new `customFilter()` function on `$animateProvider` (similar
to `classNameFilter()`), which can be used to filter animations (i.e. decide
whether they are allowed or not), based on the return value of a custom filter
function.
This allows to easily create arbitrarily complex rules for filtering animations,
such as allowing specific events only, or enabling animations on specific
subtrees of the DOM, etc.

Fixes angular#14891
gkalpak added a commit to gkalpak/angular.js that referenced this issue Apr 27, 2017
This commit adds a new `customFilter()` function on `$animateProvider` (similar
to `classNameFilter()`), which can be used to filter animations (i.e. decide
whether they are allowed or not), based on the return value of a custom filter
function.
This allows to easily create arbitrarily complex rules for filtering animations,
such as allowing specific events only, or enabling animations on specific
subtrees of the DOM, etc.

Fixes angular#14891
gkalpak added a commit that referenced this issue May 2, 2017
This commit adds a new `customFilter()` function on `$animateProvider` (similar
to `classNameFilter()`), which can be used to filter animations (i.e. decide
whether they are allowed or not), based on the return value of a custom filter
function.
This allows to easily create arbitrarily complex rules for filtering animations,
such as allowing specific events only, or enabling animations on specific
subtrees of the DOM, etc.

Fixes #14891
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants