无法在IE11上运行ES6 + Angular2

时间:2017-04-07 11:13:22

标签: angular typescript ecmascript-6 internet-explorer-11 systemjs

我正在运行angular 4.0.1,我的网站正在使用Chrome,Firefox,Safari,Edge和一些Android手机。我将我的tsconfig设置为目标ES6,并且在尝试在IE11上加载网站时出现以下错误:

"SyntaxError: Syntax error
at evaluate (mysite.com/vendor/systemjs/dist/system.src.js:2803:8)
at Anonymous function (mysite.com/vendor/systemjs/dist/system.src.js:3593:11)
at dynamicExecute (mysite.com/vendor/systemjs/dist/system.src.js:1164:5)
at doEvaluate (mysite.com/vendor/systemjs/dist/system.src.js:1111:7)
at ensureEvaluate (mysite.com/vendor/systemjs/dist/system.src.js:1020:3)
at Anonymous function (mysite.com/vendor/systemjs/dist/system.src.js:612:7)
at ZoneDelegate.prototype.invoke (mysite.com/vendor/zone.js/dist/zone.js:363:13)
at Zone.prototype.run (mysite.com/vendor/zone.js/dist/zone.js:125:17)
at Anonymous function (mysite.com/vendor/zone.js/dist/zone.js:760:17)
at ZoneDelegate.prototype.invokeTask (mysite.com/vendor/zone.js/dist/zone.js:396:13)
at Zone.prototype.runTask (mysite.com/vendor/zone.js/dist/zone.js:165:21)
at drainMicroT"

我的index.html看起来像:

<!DOCTYPE html>
<html lang="en">
    <head>
        <script>document.write('<base href="' + document.location + '" />');</script>
        <title>My Site</title>
        <meta charset="UTF-8">
        <meta name="viewport" content="width=device-width, initial-scale=1">
        <link href="https://fonts.googleapis.com/css?family=Montserrat" rel="stylesheet">
        <link href="styles/styles.css" rel="stylesheet" />
        <link href="vendor/bootstrap/dist/css/bootstrap.css" rel="stylesheet">
        <link href="vendor/font-awesome/css/font-awesome.min.css" rel="stylesheet">
        <!-- For older browsers -->
        <script src="vendor/core-js/client/shim.min.js"></script>

        <script src="vendor/zone.js/dist/zone.js"></script>
        <script src="vendor/systemjs/dist/system.src.js"></script>
        <script src="vendor/jquery/dist/jquery.min.js"></script>
        <script src="vendor/tether/dist/js/tether.min.js"></script>
        <script src="vendor/bootstrap/dist/js/bootstrap.min.js"></script>
        <script src="systemjs.config.js"></script>
        <script>
                SystemJS.import('app')
                        .catch(function(err){ console.error(err); });
        </script>
    </head>
    <body>
        <my-app>
            Loading...
        </my-app>
    </body>
</html>

package.json中的依赖项列表:

"dependencies": {
    "@angular/animations": "^4.0.0",
    "@angular/common": "^4.0.0",
    "@angular/compiler": "^4.0.0",
    "@angular/core": "^4.0.0",
    "@angular/forms": "^4.0.0",
    "@angular/http": "^4.0.0",
    "@angular/platform-browser": "^4.0.0",
    "@angular/platform-browser-dynamic": "^4.0.0",
    "@angular/router": "^4.0.0",
    "@ng-bootstrap/ng-bootstrap": "^1.0.0-alpha.21",
    "@types/node": "^7.0.11",
    "bootstrap": "^4.0.0-alpha.6",
    "core-js": "^2.4.1",
    "font-awesome": "^4.7.0",
    "rxjs": "^5.3.0",
    "systemjs": "^0.20.11",
    "tether": "^1.4.0",
    "zone.js": "^0.8.5"
  },
  "devDependencies": {
    "concurrently": "^3.4.0",
    "del": "^2.2.2",
    "gulp": "^3.9.1",
    "gulp-typescript": "^3.1.6",
    "lite-server": "^2.3.0",
    "typescript": "^2.2.1"
  }

我是否遗漏了我应该用于IE11或Android中的某些浏览器的任何pollyfill /垫片?

0 个答案:

没有答案