Skip to content
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

Disabled animation on load #10

Open
andy200486 opened this issue May 17, 2018 · 3 comments
Open

Disabled animation on load #10

andy200486 opened this issue May 17, 2018 · 3 comments

Comments

@andy200486
Copy link

Is it possible to not render the animation on load of the application ?

When the page load, the animation is rendered on the div where i set your component, but i won’t...

Could you help me please ?

@jiayihu
Copy link
Owner

jiayihu commented Jun 13, 2018

If you do not make any state transition, as defined in the animation usage, then it won't animate on render. Also be sure to have an initial state and not undefined

@madhavan-sundararaj
Copy link

Is there any solution for this issue yet?

Thanks

@kepelrs
Copy link

kepelrs commented Nov 30, 2019

My solution on Angular 8

import { trigger, transition, useAnimation } from '@angular/animations';
import { flash } from 'ng-animate';

@Component({
    selector: "my-component",
    templateUrl: "my-component.html",
    styleUrls: ["my-component.scss"],
    animations: [trigger("flash", [transition("0 <=> 1", useAnimation(flash))])]
})
export class MyComponent {
    flash = false;

    triggerFlash() {
        this.flash = !this.flash;
    }
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants