【问题标题】:Exact script order for Angular2 2.0.0-beta.17Angular2 2.0.0-beta.17 的确切脚本顺序
【发布时间】:2016-05-11 06:55:09
【问题描述】:

我正在编写一个 Angular2 2.0.0-beta.17 应用程序。 我想我以错误的顺序包含了 angular2 的各种 polyfills 和 shim。不幸的是,这个版本的 angular 文档已经消失,取而代之的是 rc.1 的文档。 我暂时不想搬到 rc.1。 你们知道或记得必须加载这些脚本的确切顺序吗? 实际上,我按以下顺序加载它们:

    <!-- IE required polyfills, in this exact order -->
    <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/systemjs/dist/system.js"></script>

    <script src="node_modules/rxjs/bundles/Rx.min.js"></script>

    <!-- angular2 bundle-->
    <script src="node_modules/angular2/es6/dev/src/testing/shims_for_IE.js"></script>
    <script src="node_modules/angular2/bundles/angular2-polyfills.min.js"></script>
    <script src="node_modules/angular2/bundles/angular2.min.js"></script>
    <script src="node_modules/angular2/bundles/http.min.js"></script>
    <script src="node_modules/angular2/bundles/router.min.js"></script>

按照这个顺序,应用程序仍然不能在 IE8 和 Safari 上运行

谢谢!

【问题讨论】:

    标签: javascript angular polyfills


    【解决方案1】:

    这是 beta17 快速入门项目的顺序:

        <!-- IE required polyfills, in this exact order -->
        <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>
    

    【讨论】:

      猜你喜欢
      • 2016-08-30
      • 1970-01-01
      • 2016-10-20
      • 1970-01-01
      • 2016-05-24
      • 1970-01-01
      • 2016-09-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多