I would like to apply a constant style to an element during this element's animation's transition. The problem is the default behavior of a transition animates the style as well. For example in this example the red background fades during the animation (it's animated as well):
animations: [
trigger('animate', [
state('true', style({ height: '10px' })),
state('false', style({ height: '30px' })),
transition('true<=>false', [
style({ backgroundColor: 'red' }),
animate('5s'),
]),
])
]
Here I would like to have the background be constantly red as the height of the element changes. Is there a way to achieve such an effect with Angular animations?