2017-02-26 61 views
0

它工作了一段時間,之後停了下來。可能,我導入了一些組件或做了一些事情。它適用於Firefox,Chrome,Edge,但不適用於IE11。Angular2 Final不能在IE11下工作

我得到的錯誤來自Angular2核心庫。

它說

SCRIPT5007:無法獲取屬性未定義或空引用

,並點 '應用' 這個功能

  function combine(options) { 
       return (_a = ((Object))).assign.apply(_a, [{}].concat(options)); 
       var _a; 
      }    

從角intl.ts文件 https://github.com/angular/angular/blob/master/modules/@angular/common/src/pipes/intl.ts

我該如何解決這個問題並使其工作IE瀏覽器?

+0

您是否加載了polyfills? –

+0

如何檢查我加載了polyfills?我有這個文件polyfills.ts結構,但不知道它是否包括在內。 – Markus

+0

https://angular.io/docs/ts/latest/guide/browser-support.html –

回答

1

index.html中巴貝爾腳本可以幫助您:在使用angular2 CLI 2.4

<script src="https://cdnjs.cloudflare.com/ajax/libs/babel-core/5.6.15/browser-polyfill.min.js"></script>

0

*將出現在IE上述問題。

要解決此問題,請確保您使用的角度CLI

/** IE9, IE10 and IE11 requires all of the following polyfills. **/ 

    import 'core-js/es6/symbol'; 
    import 'core-js/es6/object'; 
    import 'core-js/es6/function'; 
    import 'core-js/es6/parse-int'; 
    import 'core-js/es6/parse-float'; 
    import 'core-js/es6/number'; 
    import 'core-js/es6/math'; 
    import 'core-js/es6/string'; 
    import 'core-js/es6/date'; 
    import 'core-js/es6/array'; 
    import 'core-js/es6/regexp'; 
    import 'core-js/es6/map'; 
    import 'core-js/es6/set'; 

它的工作對我來說進口這需要polyfills在polyfills.ts文件的項目。