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 recipe. This will give you the framework necessary to define your TypeScript configuration.
How to do it...
To configure TypeScript, you'll need to add declaration files to incompatible modules and generate a configuration file that will specify...