Tuesday, April 11, 2017

Installing TypeScript in Visual Studio

In this first tutorial of TypeScript we will get to know how to install TypeScript in Visual Studio and use it in the same. Starting from the scratch Microsoft provides different extension for TypeScript for different versions of Visual Studio. So I have Visual Studio installed in my PC. So, I will go with VS 13 but for later versions it is almost same to install the TypeScript.

1. To download TypeScritpt for Visual Studio follow the below links
 Download the application and install it.

2. After installing the patch open Visual Studio and create a new web project. Right click on the solution and you can see there is a option in the menu to add TypeScript file.

3. Add the TypeScript file with extension .ts. At the time of adding this file if your project doesn't contain the TypeScript compiler DLL then it will prompt you and will redirect you to Nuget Package Manager to install that.

4. Install the Microsoft.TypeScript.Compiler using Nuget Package Manager or you can download it using Package Manager console.

PM> install-Package Microsoft.TypeScript.Compiler

5. Your TypeScript is ready for coding, Write a few lines of code and save it. after saving you will see a JavaScript file of the same name will be generated in the same domain.

Click on the Show All Files button to show the files that are not included in the project. Within that we will find the JavaScript file of the same name of TypeScript file.

Popular Posts