Reputation: 23
Hello im new with angular animations, i want to make my input animated when input value changes (is a calculator). I have done this, how can shoot an event to execute the animation?
@Component({
selector: 'xxxxx',
templateUrl: './yyyy.html',
styleUrls: ['./example.scss'],
animations: [
trigger('simpleFadeAnimation', [
state('in', style({opacity: 1})),
transition(':enter', [
style({opacity: 0}),
animate(600)
])
])
]
})
Upvotes: 2
Views: 1695
Reputation: 57981
you can use wild cards
animations: [
trigger('simpleFadeAnimation', [
transition('*=>*', [
style({opacity: 0}),
animate(600)
])
])
]
So, you can use
<div [@simpleFadeAnimation]="value">
.....some...
</div>
Each time you change the variable "value", the animation begings
Upvotes: 4