Setup TypeScript in Visual Studio

 
TypeScript is a typed superset of JavaScript . TypeScript is a language which compile code into JavaScript . It's not like other script language like Coffee script , Jquery etc. which run into client side , compiler compile the code into server and its automatically generate JavaScript TypeScript adds optional types, classes, and modules to JavaScript. 

You can learn more about TypeScript here - http://www.codeandyou.com/2015/06/introduction-of-typescript.html

We are showing step by step by instructions to setup TypeScript in Visual Studio 2013.

1. Download TypeScript for Visual Studio 2013
2. Install download TypeScript file
3. Open Visual Studio and Create New Empty Project.
4. Add index.html file.
5. Add one new TypeScript file index.ts into your project
6. Build Solution
7. Publish Project and see index.html

1. Download TypeScript for Visual Studio 2013

https://visualstudiogallery.msdn.microsoft.com/3e5ba71c-abea-4d00-b81b-a62de3ad3d53


 2. Install download TypeScript file




3. Open Visual Studio and Create New Empty Project.




4. Add index.html file and use following html code.



 

<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title></title>
</head>
<body>
    <div id="message"></div>
</body>
<script src="index.js" type="text/javascript"></script>
</html>

 5. Add one new TypeScript file index.ts into your project and use following code.





function ShowHello() {
    return "Hello, World";
}

document.getElementById("message").innerText = ShowHello();  

6. Build Solution -  After successful build you will see index.js . index.ts file automatically converted into .js file.



7. Publish Project and see index.html


Great TypeScript Worked ! 

Comments