Hello World

TypeScript files have a .ts extension. The extension supports both JavaScript and TypeScript. This means that it is correct to write JavaScript code in a .ts file without TypeScript. Let's see an example.

First, make an index.html file with the following minimal bootstrap markup:

<!-- Code 2.1.html --><html> <head>   <title>Example 2.1: Hello World</title>   <!-- Include Bootstrap and custom style -->   <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">   <link rel="stylesheet" href="2.1.css"> </head> <body>   <div class="container">     <div class="col-md-4 col-md-offset-4 main">       <h3 class="messenger"></h3>     </div>     <div class="col-md-4 col-md-offset-4 main"> <input type="text" class="form-control"> ...

Get TypeScript 2.x for Angular Developers now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.