angular.dev.js 和 angular.sfx.dev.js 有什么区别?

What’s the difference between angular.dev.js and angular.sfx.dev.js?

任何人都可以解释 https://code.angularjs.org/2.0.0-alpha.20 上的 angular 2 alpha 版本中这两个文件之间的区别。

从查看源代码来看,似乎在 sfx.dev.js 中 global.System 对象被覆盖,删除了 'import' 和 'config' 函数。

这就是所谓的Self-Executing bundle. Check out this comment。它说:

This bundle executes its main module - angular2_sfx, when loaded, without a corresponding System.import call. It is aimed at ES5 developers that do not use System loader polyfills (like system.js and es6 loader).

因此您不需要将 System.js 添加到您的项目中。只需将下一行添加到您的 html 页面:

<script src="https://code.angularjs.org/2.0.0-alpha.20/angular2.sfx.dev.js"></script>
<script src="app.js"></script>
<script>
  document.addEventListener('DOMContentLoaded', function() {
    angular.bootstrap(App);
  });
</script>

这里plunker展示了它是如何工作的。