Angular 2

As mentioned at the start of this chapter, Angular 2 is a complete rewrite of Angular 1, and uses TypeScript as its language of choice. In this section of the chapter, we will take a look at how the Model View Controller design pattern is used within Angular 2.

Angular 2 setup

Similar to Aurelia's command-line development environment setup, Angular 2 also has a command-line project setup tool, named the Angular-CLI. This can be installed using npm as follows:

npm install -g angular-cli

Once the command-line interface has been installed globally, we can set up an Angular 2 development environment by using the Angular-CLI as follows:

ng new my-app

The Angular-CLI is named ng, and here we have specified that it should create a new project ...

Get Mastering TypeScript - Second Edition now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.