[英]what is the purpose of these angular2 imports?
I am a newbie in angular2 and want to know the purpose of following imports we do in our angular2 app. 我是angular2的新手,想知道我们在angular2应用程序中进行导入的目的。
<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/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/http.dev.js"></script>
so my questions regarding these imports are: 所以我对这些进口商品的疑问是:
Thanks in advance. 提前致谢。
I don't see any imports in your code sample. 在您的代码示例中没有看到任何导入 。 Its just including the files of various libraries into web page.
它只是将各种库的文件包含到网页中。 If you read some of them one by one:
如果您逐一阅读其中的一些内容:
So you can google each of the names and figure out for yourself if that's applicable for your project. 因此,您可以搜索每个名称,然后自己确定是否适用于您的项目。
More on modules and actual imports
in ES2015/ES6 you can read here https://ponyfoo.com/articles/es6-modules-in-depth for example. 有关ES2015 / ES6中模块和实际
imports
更多信息,例如,您可以在此处阅读https://ponyfoo.com/articles/es6-modules-in-depth 。
"useful imports that we must be aware of?" “我们必须意识到有用的进口?”
Totally depends on your needs. 完全取决于您的需求。 By I assume angular2.dev.js and http.dev.js would be a good to start.
我认为angular2.dev.js和http.dev.js是一个很好的开始。
"does the sequence of these imports matter?" “这些进口的顺序重要吗?”
Not now, but only if you're using proper module system so that browser can load missing parts before executing the blocks that depend on them. 不是现在,但是只有当您使用适当的模块系统时,浏览器才能在执行依赖于它们的块之前加载缺少的部分。 And also the loader file (system.js/require.js) should be in the first before all the other files.
加载程序文件(system.js / require.js)也应位于所有其他文件之前的第一个。
Here are the details about what you specified in your script elements: 以下是有关您在脚本元素中指定的内容的详细信息:
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.