In this animation I try to decrease the width from 100% to a dynamic start width "toolWidth" (percent). The variable "toolWidth" can be set by the user in the app.
Animation:
trigger('testAnimation', [
state('opened', style({
'width': '100%'
})),
state('*', style({
'width': '{{toolWidth}}%'
}), {params: {toolWidth: 30}}),
transition('* => opened', animate('600ms ease-in')),
transition('opened => *', animate('600ms ease-out'))
])
Template:
<div [@testAnimation]="{value: state, params: {toolWidth: newToolWidth}}"></div>
Problem:
If the variable "state" is changed to "closed", nothing happens. It seems that the animation does not get triggered with the new state "opened". The initial value of "state" is "opened". The variable "newToolWidth" is set by the user. If I don't use parameters it works very well.
Did I miss something?