Angular 4 动画在 Edge 中不工作

Angular 4 Animation not working in Edge

我创建了一个在整个项目中使用的动画,但它在 Edge 浏览器中不起作用。这是我正在使用的代码,有人知道我可以做些什么来修复它吗?

import {animate, state, style, transition, trigger} from '@angular/core';

export const animation = trigger('slideInOutAnimation', [

  state('*', style({

  })),
  transition(':enter', [
    style({
      '-webkit-transform': 'translateY(-50%)',
      transform: 'translateY(-50%)',
    }),
    animate('.5s ease-in-out', style({
      '-webkit-transform': 'translateY(0)',
      transform: 'translateY(0)',
    }))
  ]),
  transition(':leave', [
    animate('.5s ease-in-out', style({
      '-webkit-transform': 'translateY(-50%)',
      transform: 'translateY(-50%)',
    }))
  ])
]);

来自 pollyfills.ts 请取消注释导入 'web-animations-js';和 运行 命令 npm install --save web-animations-js.
如果您没有任何 pollyfills 文件,请参考 official link 创建一个