TypeScript Installation


Installing TypeScript

TypeScript can be installed in two ways:

  • Via npm (Node.js package manager)
  • Install TypeScript's Visual Studio plug-ins

The good news, Visual Studio 2015 and 2013 (with Update 2) by default support TypeScript. If you haven't installed TypeScript yet for your Visual Studio, you can download it now from here.

When you visit here, you will find different plug-ins are available here for different Visual Studio versions. Some other plug-ins are also available here, if you are using other tools like Eclipse, Vim or Atom etc.

Other than above plug-ins, command-line TypeScript compiler is also available and can be installed as a Node.js package.

To install TypeScript:

npm install -g typescript

If you're using one of the supplied IDEs or editors, then you won't have to do this step, but it is good to know. You can compile a TypeScript file to a JavaScript file with the following command.

To compile:

tcs helloWord.ts

See TypeScript in Action here:

class Customer {
	Name : string;
	constructor (firstName: string, lastName: string)
	{
		this.Name = firstName + "  " + lastName;
	}
	GetName()
	{
		return "Hello, " + this.Name;
	}
}
let cust = new Customer("Jimi","Scott");

let button = document.createElement('button');
button.textContent = "Display Full Name";
button.onclick = function() {
    alert(cust.GetName());
}
document.body.appendChild(button);

TypeScript With Visual Studio 2015



Live Demo


See Also

AngularJS Built-in Filters
AngularJS Built-in Directives
AngularJS Expression
AngularJS Built-in Events
AngularJS Scope Methods
AngularJS Built-in Services
AngularJS Controller Inheritance
AngularJS Custom Directives



 
 
SHARE THIS IF YOU LIKE!
submit to reddit

TYPESCRIPT LANGUAGE TECHNIQUES

SUBSCRIBE FOR LATEST UPDATES
HAVE WE CONNECTED ON FACEBOOK?
TOP TUTORIALSTOP CODE EXAMPLESTOP LIVE DEMOLINKSSTAY CONNECTED
HTML Tutorial
HTML5 Tutorial
Bootstrap3 Tutorial
Javascript Tutorial
TypeScript Tutorial
AngularJS Tutorial
CSharp Tutorial
PHP Tutorial
Developer Tools
Javascript
AngularJS
Google MAP API V3
ASP.NET
Javascript
AngularJS
Google MAP API V3
Contact Us
Advertise with Us
Privacy Policy
Disclaimer
Stay connected. We actually like you. If you want to get up to the minute updates, then connect with us on your fav below.
 
Twitter   Linkedin   Facebook   Google+    RSS   Pinterest
 
Protected by Copyscape Original Content Checker
 
 
Copyright ©2017 www.techstrikers.com Unauthorized reproduction/replication of any part of this site is prohibited.