Angular2 – Typescript cheatsheet

    This cheat sheet is provisional and may change!

Installing Typescript and its typings

tsd install  // install typings package command
typings install // install ttypings package command
typings install dt~underscore --global --save // install typings for underscore

Declaring third party libraries.

declare var <third-party-namespace>: any;
declare var JSONEditor: any;

Importing third party libraries.

import * as _ from 'underscore'; // import underscore to be used inside ts code

Add a Comment

Your email address will not be published. Required fields are marked *

To prove you're a person (not a spam script), type the security word shown in the picture. Click on the picture to hear an audio file of the word.
Anti-spam image