Over a million developers have joined DZone.
{{announcement.body}}
{{announcement.title}}

Getting Started with TypeScript in Visual Studio 2012

DZone's Guide to

Getting Started with TypeScript in Visual Studio 2012

·
Free Resource

On October 1, Microsoft announced TypeScript. The open source preview is available for download from the Microsoft Download Center.

TypeScript adds optional types, classes, and modules to JavaScript allowing the developer to make better tooling for large scaled JavaScript apps. TypeScript comes with the cross platform compiler and compiles to standards-based JavaScript.

To get started, download TypeScript for Visual Studio 2012 from the link below and install the msi file.

Once you install, open your existing web project in Visual Studio 2012 and “Add New Item” -- you will see the new TypeScript File template.

TypeScript for Visual Studio 2012 - 1

TypeScript for Visual Studio 2012 – 1

Intellisense support for TypeScript

TypeScript for Visual Studio 2012 - 2

TypeScript for Visual Studio 2012 – 2

class Employee {
	Name: string;
	constructor (message: string) {
		this.Name = message;
	}
	EmployeeName() {
		return "Hello, " + this.Name;
	}
}   

var emp = new Employee("Senthil Kumar");

var button = document.createElement('button')
button.innerText = "Hi "
button.onclick = function() {
	alert(emp.EmployeeName())
}

document.body.appendChild(button)

Below are some links to help you get started with TypeScript:

 

 

Topics:

Published at DZone with permission of Senthil Kumar, DZone MVB. See the original article here.

Opinions expressed by DZone contributors are their own.

THE DZONE NEWSLETTER

Dev Resources & Solutions Straight to Your Inbox

Thanks for subscribing!

Awesome! Check your inbox to verify your email so you can start receiving the latest in tech news and resources.

X

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}