To get started easy enough, however, I followed and adapted the advice found in the Quick Start tutorial from Angular 2 page. This way I got it working in less than 5 minutes! (Node.js has been already installed on my machine as a third party tool with Visual Studio 2015, though.)
Try it yourself following these steps:
- Create an Agular2Test Visual Studio project of type HTML application with TypeScript:
- Add package.json, tsconfig.json, typings.json, and systemjs.config.js files with the contents copy-pasted from the tutorial. Upon saving them, Visual Studio performs npm install command automatically for you but it may not succeed:
- Open Node.js command prompt and use command cd [path]\Angular2Test to ensure it will run in the project folder, then run npm install manually; it will take some time and create a node_modules subfolder for you:
- Replace index.html with markup containing the starting point for your Angular 2 app, as indicated in the tutorial:
- Remove the default app.ts and create an app folder under your project in Solution Explorer, including app.component.ts and main.ts, as indicated in the tutorial:
- Add styles.css as well, to finish, and build and run your first Angular 2 app developed with Visual Studio!