Angular2 Heroes app投掷随机错误 - traceur 404

时间:2016-09-23 13:18:51

标签: javascript angular typescript

启动Angular2应用时,我遇到了404 traceur错误。

enter image description here

似乎有很多人solved it by removing multiline comments

其他updated their systemjs.config.js

我已尝试过这两种方法而且都没有工作。

我用我的所有打字稿和配置文件制作了plunkr

我的systemjs.config.js:

(function (global) {
  System.config({
    paths: {
      'npm:': 'node_modules/'
    },
    map: {
      app: 'app',
      '@angular/core': 'npm:@angular/core/bundles/core.umd.js',
      '@angular/common': 'npm:@angular/common/bundles/common.umd.js',
      '@angular/compiler': 'npm:@angular/compiler/bundles/compiler.umd.js',
      '@angular/platform-browser': 'npm:@angular/platform-browser/bundles/platform-browser.umd.js',
      '@angular/platform-browser-dynamic': 'npm:@angular/platform-browser-dynamic/bundles/platform-browser-dynamic.umd.js',
      '@angular/http': 'npm:@angular/http/bundles/http.umd.js',
      '@angular/router': 'npm:@angular/router/bundles/router.umd.js',
      '@angular/forms': 'npm:@angular/forms/bundles/forms.umd.js',
      'rxjs':                       'npm:rxjs',
      'angular2-in-memory-web-api': 'npm:angular2-in-memory-web-api',
    },
    packages: {
      app: {
        main: './main.js',
        defaultExtension: 'js'
      },
      rxjs: {
        defaultExtension: 'js'
      },
      'angular2-in-memory-web-api': {
        main: './index.js',
        defaultExtension: 'js'
      }
    }
  });
})(this);

1 个答案:

答案 0 :(得分:0)

尝试将'use strict';添加到systemjs配置文件的顶部。这件事发生在我身上,如果我记得,那解决了它。