I know how to add animations with parametres from HTML, as follows:
Animations.ts
trigger('slowXMove', [
state('posX1State', style({
left: '{{posX1}}px'
}), {params: {posX1: '0px'}}),
state('posX2State', style({
left: '{{posX1}}px'
}), {params: {posX1: '0px'}}),
transition('posX1State => posX2State', animate('2s')),
transition('posX2State => posX1State', animate('2s'))
])
HTML
<img [@slowXMove]="{value: stateX, params: {posX1: posXImg1}}" ...
Now I need to do same but from component.ts. I know how to do without without parametres, as follows:
@HostBinding('@myanimation') state= 'state1';
But, how can I agree Parametres to my animation from component.ts?