I have recently updated my Angular app to 4.0 in order to take advantage of the animation between routes.
Below is my animation function:
export function routerTransition() {
return trigger('routerAnimations', [
transition('home => development, design => home', [
query(':enter, :leave', style({ position: 'absolute', top: 0, left: 0, right: 0 })),
query(':leave', style({ zIndex: 100 })),
query(':enter', style({ transform: 'translateX(100%)', opacity:1 })),
group([
query(':leave', group([
animate('0.7s cubic-bezier(0.68, -0.75, 0.265, 1.55)', style({ transform: 'translateX(-100%)', opacity:0 }))
])),
query(':enter', group([
animate('0.7s cubic-bezier(0.68, -0.75, 0.265, 1.55)', style({ transform: 'translateX(0%)' }))
]))
])
]),
transition('home => design, development => home', [
query(':enter, :leave', style({ position: 'absolute', top: 0, left: 0, right: 0 })),
query(':leave', style({ zIndex: 100 })),
query(':enter', style({ transform: 'translateX(-100%)', opacity:1 })),
group([
query(':leave', group([
animate('0.8s cubic-bezier(0.68, -0.75, 0.265, 1.55)', style({ transform: 'translateX(100%)', opacity:0 }))
])),
query(':enter', group([
animate('0.8s cubic-bezier(0.68, -0.75, 0.265, 1.55)', style({ transform: 'translateX(0%)' }))
]))
])
])
])
}
For some reason when I change the timing of one transition to be the same as the other (i.e. change "0.7s" to "0.8s") I get the following error:
The CSS property "transform" that exists between the times of "0ms" and "800ms" is also being animated in a parallel animation between the times of "0ms" and "800ms"
The two animations shouldn't overlap as the stateChangeExpr
is different for each transition.
What am I missing?