簡體   English   中英

Angular 4不適用於IE 9

[英]Angular 4 doesn't work with IE 9

我正在嘗試使用IE 9啟動Angular應用程序(ng新的“ appname”),但僅當我使用打開的IE9開發工具窗口重新加載頁面時,它才有效

我在polyfills.ts中添加了(取消注釋)所有必要的polyfills

這是視頻

角4.2.4

更新謝謝馬丁

最終使其與console-polyfill和zonejs一起使用

<script type="text/javascript" src="inline.bundle.js"></script>
<script type="text/javascript" src="polyfills.bundle.js"></script>
<script type="text/javascript" src="zone.js"></script>
<script type="text/javascript" src="main.bundle.js"></script>

看起來您在代碼中使用console (問題出在main.bundle.js )。 如果要同時使用它並支持IE9,則需要為其添加另一個polyfill。

您可能會用到它:

https://github.com/paulmillr/console-polyfill

我嘗試創建並構建新應用,有一種console用法,它在src/main.ts文件中,您還可以檢查是否支持console ,並且僅在這種情況下使用它:

platformBrowserDynamic().bootstrapModule(AppModule)
  .catch(err => 'console' in window ? console.log(err) : null);

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM