索引.html Angular2 RC.0.1 的导入



我最近将我的 ng2 应用程序从 beta2.0.12 升级到 rc.0.1。以前我的索引中有以下导入.html:

<script src="node_modules/es6-shim/es6-shim.min.js"></script>
<script src="node_modules/systemjs/dist/system-polyfills.js"></script>
<script src="node_modules/angular2/es6/dev/src/testing/shims_for_IE.js"></script>
<script src="node_modules/angular2/bundles/angular2-polyfills.js"></script>
<script src="node_modules/systemjs/dist/system.src.js"></script>
<script src="node_modules/rxjs/bundles/Rx.js"></script>
<script src="node_modules/angular2/bundles/angular2.dev.js"></script>
<script src="node_modules/angular2/bundles/router.dev.js"></script>
<script src="node_modules/angular2/bundles/http.dev.js"></script>

rc.0.1 的相应导入是什么。感谢任何指示。

谢谢

好问题首先我对 RC.0 中的导入感到困惑,但比我找到了答案,

实际上在 Angular2 的 RC.0 中,system.config.js文件中提到了所有导入,仔细查看此文件,然后在此处看到所有导入

(function (global) {
  var map = {
    ...
    '@angular': 'node_modules/@angular'   // here angular2 bind all the imports of @angular from the node_modules folder itself
                                            instead of importing in the index.html
    ...
  };
  var packageNames = [
    '@angular/common',      //Here all the imports bind by name like from core/common and all...
    '@angular/compiler',
    '@angular/core',
    '@angular/http',
    '@angular/platform-browser',
    '@angular/platform-browser-dynamic',
  // '@angular/router',
    '@angular/router-deprecated',
    '@angular/testing',
    '@angular/upgrade',
  ];
})(this);

所以在RC.0中不需要在索引中导入angular.dev/router/http angular文件.html文件。导入已通过 System.config.js 文件导入。

最新更新