Dec 3, 2017

Simple TypeScript Application.!

Here is the simple TypeScript  application using the Visual studio.

Open Visual studio 2017- I have installed the express version it's free to for all from Visual studio community

Step 1:

Create project from the below screen

Step 2 :

Choose type script templates from left and select Blank node.js console application from below screen


Step 3: after creation of the project solution is like this



Step 4: open the app.ts filed and paste the below code.


var message: string = "Hello this is type script sample";

console.log(message);

step 5: run the project and verify the out put in command prompt

Here is the out put:


that's we are done with hello world Type script program.

as i told type script is a super set of java script.

the moment you compile the code it converts into java script

Type script code before conversion:

var message: string = "Hello this is type script sample";

console.log(message);

after conversion to Pure java script

//Generated by typescript 
var message = "Hello this is type script sample";

console.log(message);


No comments:

Post a Comment