2016-07-26 44 views
2

我正在關注this Angular 2官方教程。當我運行npm install時,我得到一個名爲node_modules的文件夾,其中12.523項和66 MB。哪些文件是Angular?我對此完全陌生。我只需要Angular js文件和核心依賴項,我可以在哪裏找到它們?如何安裝Angular 2?只有Angular

回答

3

npm用於下載依賴到您的項目。它下載源代碼,但您需要在HTML中添加對它們的引用。該教程中,你可以看到這一點後實現:

... 
<script src="node_modules/core-js/client/shim.min.js"></script> 

<script src="node_modules/zone.js/dist/zone.js"></script> 
<script src="node_modules/reflect-metadata/Reflect.js"></script> 

<script src="node_modules/rxjs/bundles/Rx.umd.js"></script> 
<script src="node_modules/@angular/core/bundles/core.umd.js"></script> 
<script src="node_modules/@angular/common/bundles/common.umd.js"></script> 
<script src="node_modules/@angular/compiler/bundles/compiler.umd.js"></script> 
<script src="node_modules/@angular/platform-browser/bundles/platform-browser.umd.js"> 
... 

認真按照教程:)

1

使用源文件像往常一樣 生成源到一個文件中,並從HTML文件

加載它們
+0

哪些是移動源文件? – alejoss

+0

@alejoss在上面的答案中使用源代碼鏈接,所有這些都在'node_modules'文件夾內 – uamanager

+0

好吧,我認爲那些源代碼加上一些額外的非常規文件。 – alejoss