编程语言
首页 > 编程语言> > Javascript-Angular 2如何支持Internet Explorer 9?

Javascript-Angular 2如何支持Internet Explorer 9?

作者:互联网

最近,Angular 2团队宣布将支持Internet Explorer9.我想知道,这怎么可能?

我现在使用Angular 1,所以我阅读了很多有关Angular 2的知识,并尝试了一些练习.我非常确定Angular 2可以比Angular 1更快,因为它使用了EcmaScript 6的新功能和新事件.据我所知,Internet Explorer根本不提供此事件和功能.

那么,诀窍在哪里?没有此新功能,Angular 2如何支持IE9?我知道TypeScript可以在ES3中进行编译.但是它不能添加新功能,例如新的DOM事件.

解决方法:

您必须在Angular 2项目的代码中包含angular2-polyfills.js(或angular2-polyfills.min.js). (当前版本Angular 2.0.1 beta)

该库将缺少的polyfill添加到浏览器.

polyfill(或polyfiller)是附加代码,可提供Web浏览器未内置的功能….https://en.wikipedia.org/wiki/Polyfill

标签:angular,angularjs,internet-explorer,internet-explorer-9,javascript
来源: https://codeday.me/bug/20191119/2034219.html