Created
February 6, 2020 08:23
-
-
Save sanketmaru/72204e52b98b59044b9e5f56062eeafc to your computer and use it in GitHub Desktop.
Animating list of items in Angular 8
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { trigger, state, style, animate, transition, query, stagger, group } from '@angular/animations'; | |
export const listAnimation = trigger('listAnimation', [ | |
transition('* => *', [ | |
// each time the binding value changes | |
query(':enter', [style({ opacity: 0 }), stagger('60ms', animate('600ms ease-out', style({ opacity: 1 })))], { | |
optional: true | |
}), | |
query(':leave', animate('200ms', style({ opacity: 0 })), { optional: true }) | |
// query(':leave', [ | |
// stagger(100, [ | |
// animate('0.5s') | |
// ]) | |
// ], { optional: true }), | |
// query(':enter', [ | |
// style({ opacity: 0 }), | |
// stagger(100, [ | |
// animate('0.5s') | |
// ]) | |
// ], { optional: true }) | |
]) | |
]); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment