Code Generation for Modules Depending on the module target specified during compilation, the compiler will generate appropriate code for Node
Contextual Type Type inference also works in “the other direction” in some cases in TypeScript. This is known as “contextual typing”. Contextual
Install typings for dependencies Angular 2 includes es6-shim for Promise support, but TypeScript still needs the types. Open a command prompt
jspm
Write a simple Angular app in TypeScript First, change the code in app.ts to:
Global Libraries A global library is one that can be accessed from the global scope (i.e. without using any form of import)
Any We may need to describe the type of variables that we do not know when we are writing an application. These values may come from dynamic
Advanced Combinations Some kinds of declarations can be combined across multiple declarations. For example, class C { } and interface
Putting it all together Just run: tsc Now
Ambient enums Ambient enums are used to describe the shape of already existing enum types.
Page 20 of 29