New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Animation not working when combined query selector with tokens #44101
Comments
|
I think you need to either let the animation control the visibility of your child element (look into sequence or stagger), or create a separate trigger for your element. Right now, within your current animation the element is not found because Angular doesn't render it yet (because of the if-statement). Your example looks like it should all be controlled from the animation, like a sequence of events. However, if you just want a condition to control the animation, you can add a separate trigger: https://stackblitz.com/edit/angular-ivy-vsa8b4 |
|
Hi @mslooten, thanks for your quick reply. I think, the token(:enter, :leave) can control the visibility or presence in the DOM for an element. |
|
Hi @thirumanidev, ah I understand. Looking at the docs it should be possible, the usage notes example is basically what you're trying to do. Edit: |
|
Hi @mslooten, |
|
Hi @thirumanidev please check your stackblitz and notice that the error in the console appears right away and not when you set So when your Am I missing something? PS I am not too sure what you mean with the following:
But just to clarify, the |


Which @angular/* package(s) are the source of the bug?
animations
Is this a regression?
No
Description
I'm trying to animate child element with query selector(class name) & token(:enter),
but it throws error as follwoing
_ERROR
Error: Unable to process animations due to the following failed trigger transitions
@animation1 has failed due to:
query(".text4:enter")returned zero elements. (Usequery(".text4:enter", { optional: true })if you wish to allow this.)_I mean it:
https://angular.io/api/animations/query#usage-notes
Please provide a link to a minimal reproduction of the bug
https://stackblitz.com/edit/angular-ivy-rtayah?file=src/app/app.component.ts
Please provide the exception or error you saw
Please provide the environment you discovered this bug in
Anything else?
No response
The text was updated successfully, but these errors were encountered: