The angular 2 animate documentation is very poor, so I started playing with it and decided to make some nice animation like fading, between 2 images.
My current image has the animation trigger all set up:
<img src="myimage.png" class="img img-responsive"
[@travelState]="travelState"
>
animations: [
trigger('travelState', [
state('inactive', style({
})),
state('active', style({
//Change image src
})),
transition('inactive => active', animate('100ms ease-in')),
transition('active => inactive', animate('100ms ease-out'))
])
]
Now, switching between inactive state and active state has to change the image src attribute to another image, with fading transition.
How I can change the src image attribute when the image triggers active state?