Angular 2使用CLI使用JIT进行翻译

时间:2017-02-10 12:44:52

标签: angular angular-cli jit

我正在尝试使用jit运行Angular 2 i18n translation。不幸的是我得到一个错误说,没有定义变量“系统”。所以我从npm下载了它。我把它包含在angular-cli.json中,所以它被加载了。但是在声明System变量之前加载了index.html中的scriptblock。

<script>
  // Get the locale id somehow
document.locale = 'de-de';

// Map to the text plugin
System.config({
  map: {
    text: 'systemjs-text-plugin.js'
  }
});

// Launch the app
System.import('main.js').catch(function(err){ console.error(err); });
</script>

我该如何解决这个问题?

0 个答案:

没有答案
相关问题