angular-animations
angular-animations copied to clipboard
How to achieve the following with your library?
// html
<span [@fadeAnimTrigger]="wordIndex">{{words[wordIndex]}}</span>
// ts
animations: [
trigger('fadeAnimTrigger', [
transition(':decrement', [
style({ opacity: 0 }), animate('500ms', style({ opacity: 1 }))
]),
transition(':increment', [
style({ opacity: 0 }), animate('500ms', style({ opacity: 1 }))
]),
])
I'm trying to replace style({ opacity: 0 }), animate('500ms', style({ opacity: 1 }))
in the above code with your fadeIn
Hi @anandchakru,
It's an interesting use case. Currently the library doesn't support :increment
and :decrement
selectors. I'll have a look how we could incorporate similar use cases to the library.
In the example you posted, the animation for :increment
and :decrement
are the same, so maybe you can do sth like in this Stackblitz example