How to set up a project build workflow for an Angular 2 web application from scratch using npm, TypeScript, and Webpack.
In this first part we start with an empty folder, add an index.html file and the code for a basic Angular component. Then we write a package.json file with all the Angular modules and dependencies, briefly explain what each dependency is for, and finally use npm to download them all.
This is an extract from my “Angular 2 From The Ground Up” course. You can get early access to the full course here:
Code snippets (updated for Angular 2.0.1):
Update: after Angular 2.0.0-rc.5 the code in main.ts needs to be slightly different and you also need an app.module.ts. See steps 2 to 4 in the Angular QuickStart page: