Does Angular 5 polyfill async / await for IE11

橙三吉。 提交于 2019-12-05 00:00:50

问题


We develop a software which needs to be supported by IE11. As multiple sources state, IE11 does not support async/await:

  • https://caniuse.com/#feat=async-functions
  • http://kangax.github.io/compat-table/es2016plus/

as well as several blog-articles.

We did now write a simple Angular 5 project which uses async/await and it is working fine in IE11. Can we safely assume that Angular uses some kind of polyfill to add support for this in IE11? I cannot find any source stating that Angular adds support for it.


回答1:


As of TypeScript 2.1, the TypeScript compiler has support for compiling async/await code down to a form that works even on IE6!

So, if your tsconfig.json has the target set to ES5 or lower (which is the case by default in Angular CLI projects), TypeScript will handle this conversion for you. The only feature you'd potentially need to polyfill to be able to make use of this would be Promise.



来源:https://stackoverflow.com/questions/52476012/does-angular-5-polyfill-async-await-for-ie11

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!