#each scripts.polyfills 来自谁?

Who is the #each scripts.polyfills coming from?

我已经使用 angular 2 CLI 生成了一个 angular 2 应用程序。

在 index.html 文件中是这样的:

{{#each scripts.polyfills}}
    <script src="Application/{{.}}"></script>
{{/each}}

当使用 CLI 命令构建应用程序时 'ng build' index.html 的输出是:

<script src="Application/vendor/scripts1.js"></script>
<script src="Application/vendor/scripts2.js"></script>
<script src="Application/vendor/scripts3.js"></script>

现在我问你#each 来自哪里意味着什么 language/library?

我的 CLI 中定义的 scripts.polyfills 对象在哪里创建 angular 2 app.

我在任何地方都找不到名称为 'scripts' 的 folder/variable。

polyfill 内置于 angular-cli 工具中。 Polyfill for angular

在链接页面中搜索 options.polyfills。 如果你想包含其他 polyfill,可以选择将它包含在 angular-cli-build.js 中。例如,要将 jquery 作为 polyfill 添加到 vendorNPM 文件之外的 polyfills 标签:-

 vendorNpmFiles: [
  'systemjs/dist/system-polyfills.js',
  'systemjs/dist/system.src.js',
  'zone.js/dist/**/*.+(js|js.map)',
  'es6-shim/es6-shim.js',
  'reflect-metadata/**/*.+(ts|js|js.map)',
  'rxjs/**/*.+(js|js.map)',
  '@angular/**/*.+(js|js.map)',
  'jquery/**/*.js'
],
polyfills:[
   'vendor/jquery/dist/jquery.min.js', 
   'vendor/es6-shim/es6-shim.js',
    'vendor/reflect-metadata/Reflect.js',
    'vendor/systemjs/dist/system.src.js',
    'vendor/zone.js/dist/zone.js', 
]