Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Does Angular 5 polyfill async / await for IE11

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.

like image 791
tommueller Avatar asked Sep 24 '18 09:09

tommueller


People also ask

Does async await work on IE?

As you can see, the async and await keywords are supported by a majority of up-to-date browsers. But of course, Internet Explorer does not support them.

Does Angular support async await?

Using Async/Await in Angular Basically, Async/Await works on top of Promise and allows you to write async code in a synchronous manner. It simplifies the code and makes the flow and logic more understandable.

Does IE 11 support async?

Internet Explorer IE browser version 6 to 11 doesn't supports JAVASCRIPT Async functions.


1 Answers

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.

like image 144
Joe Clay Avatar answered Nov 15 '22 08:11

Joe Clay