I try to animate an element in Angular 4 in terms of its height. Regardless of whether I use margin-bottom or height as attributes to be changed, the change is done, but without animation, meaning, the height/margin-bottom value is jumping from 200px to 0px immediately, without animation and even without delay (if specified).
Here is my animation code:
animations: [
trigger('ansichtState', [
state('nurSuche', style({
'margin-bottom': '200px'
})),
state('sucheUndErgebnisse', style({
'margin-bottom': '0px'
})),
transition('nurSuche <=> sucheUndErgebnisse', animate('4000ms'))
])
]
The template code is:
<header [@ansichtState]="currentAnsichtState"> </header>
currentAnsichtState
is defined correctly and changed by a separate function.
Also the margin-bottom
value changes from 200px to 0px it is done immediately (although a duration of 4000ms is specified).
What am I doing wrong?