Angular 2 required libraries

后端 未结 2 721
天命终不由人
天命终不由人 2021-02-04 18:53

I would like to start working with the Angular2 Beta, but I am facing a few problems regarding the required libraries.
I am using Eclipse and it\'s TypeScript Plugin.
Al

2条回答
  •  温柔的废话
    2021-02-04 19:35

    "What i am now looking for is an angular2 counterpart of those files":

    
    
    
    
    
    

    You need those 4 .js (not .ts) files.

    "Where can i find them?" They got downloaded with npm. You can keep those 4 and delete everything else. You can also get them from a CDN, or download them manually.

    
    
    
    
    
    
    

    HOWEVER. These are already compiled javascript files, and they'll work for you if you write your app using JS, but right now 90% of the scarse documentation you will find about Angular 2 is on typescript and in order to work with typescript you'll need the source files of Angular 2 which is the whole package you are getting.

    My suggestion if you are doing it in typescript: Don't worry about all those files getting downloaded, they are meant for development, not neccesarily part of your build. You can only include the ones I told you in your build and that will keep you real app small. Also you are not suppose to add all those files into the git repo or w/e repo you are using, the idea is that you have git ignore the whole "node_modules" folder and you only commit the package.json file, which will work for other developers so they run npm install and they get all the dependencies themselves. So all those files are only meant to be in dev machines, you don't have to worry about them making you app too big cause they won't be part of your app.

提交回复
热议问题