How to add Web Animations API polyfill to an Angular 2 project created with Angular CLI -


the angular 2 animations documentation refers web animations api polyfill browsers don't support native one.

what's proper way add polyfill angular 2 project created angular cli?

(i using angular-cli: 1.0.0-beta.10)

with no luck, have tried ideas , solutions mentioned here:

i downloaded via npm , added system-config.ts. believe along lines of what's recommended polyfill doesn't loaded (i can tell because animations don't work in safari).

i got work including polyfill in index.html, know it's not proper way:

  <script src="https://rawgit.com/web-animations/web-animations-js/master/web-animations.min.js"></script> 

i add here details may clarify question, if need see code, have on github:

https://github.com/cmermingas/connect-four

thanks in advance!

adding polyfill newer, webpack version of angular cli easier:

  1. install npm install web-animations-js --save

  2. add polyfills.ts: require('web-animations-js/web-animations.min');

it worked if import 'web-animations-js/web-animations.min';


Comments