We have covered the definition, uses of TypeScript, why we need to use TypeScript and how to use TypeScript with Node.js and any editor like notepad in the previous article. Please click below link to go through the previous article.
In this article, we are going to learn how to use TypeScript with visual studio 2015 Update 3.
We don’t have to install TypeScript in visual studio 2015 Update 3. It includes TypeScript by default. We will be typing intellisense while working in visual studio.
We can see in below image.
We have to follow some simple steps to achieve this.
First of all, we have to click File -> New -> Project as below image.
Now Select the ASP.NET Web Application (.Net framework) and enter the name as a TypeScriptProject and Click OK.
Select template as an Empty and click OK as below.
Now Right Click on the Project file – > Add -> New Item…
Select an Item as a TypeScript File and enter the name as an index.ts and click Add as below image.
If any popup asks you about searching for TypeScript Typings then click on Yes
Now open the index.ts file and write the code like below.
We are just writing alert box here, we will focus more on codewise in our next articles.
alert(“First TypeScript Program”);
Same as above, add the HTML file in the project.
Select an Item as an HTML Page and enter the name as an index.html and click Add as below image.
Now it’s time to run the program and see the output as below.
In this article, we have covered, how to use TypeScript with visual studio update 3 for the first time and in the upcoming article, we are going to focus on coding in TypeScript.