I have a simple animation that is used when the app navigates via router to a different component.
export function routerNavigation() {
return trigger('routerNavigation', [
state('void', style({ position: 'fixed' })),
state('*', style({ position: 'fixed' })),
transition(':enter', [
style({ transform: 'translateY(200%)' }),
animate('0.5s ease-in-out', style({ transform: 'translateY(0%)' }))
]),
transition(':leave', [
style({ transform: 'translateX(0%)' }),
animate('0.5s ease-in-out', style({ transform: 'translateX(150%)' }))
])
]);
}
and the animation is added to the component like so:
@Component({
selector: 'app-branch',
templateUrl: './branch.component.html',
styleUrls: ['./branch.component.scss'],
animations: [routerNavigation()],
host: { '[@routerNavigation]': '' }
})
I have already run:
npm install --save web-animations-js`
and I have uncommented the lines in the pollyfil.js file:
import 'web-animations-js';
Notes:
- This is an angular 7 app and it works fine in chrome.
- the animation does not work in MS Edge
- the component is never added to the DOM but the services in the components.ts file are executed
I have a feeling that this has to do with the transform: 'translateY(200%)' style for the animation but I am unsure how to debug this.
Can someone help me figure out why my animations don't work in MS Edge.
Why this is not a duplicate question
All the other similar questions on SO have added the polyfill for web animations as the solution. I have already done that and it still does not work.
Thanks in advance