Configuring TypeScript for a minimum viable Angular 2 application

In order to use TypeScript alongside Angular 2, there are two major considerations: module interoperability and compilation. You'll need to handle both in order to take your application's .ts files, mix them with external library files, and output the files that would be compatible with your target device.

TypeScript comes ready as an npm package, but you will need to tell it how to interact with the files and modules you've written, and with files from other packages that you want to use in your modules.

Note

The code, links, and a live example of this are available at http://ngcookbook.herokuapp.com/1053/.

Getting ready

You should first complete the instructions mentioned in the preceding ...

Get Angular 2 Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.