<!DOCTYPE html>
<html>
<head>
<base href="." />
<title>TypeScript with System.JS</title>
<script src="https://unpkg.com/systemjs@0.19.31/dist/system.js"></script>
<script>
System.config({
transpiler: 'typescript',
packages: {
src: {
defaultExtension: 'ts'
}
},
paths: {
'npm:': 'https://unpkg.com/'
},
map: {
'app': './src',
'typescript': 'npm:typescript@2.0.2/lib/typescript.js'
}
});
System
.import('src/main')
.then(null, console.error.bind(console));
</script>
</head>
<body>
open console (F12) to see the output
</body>
</html>
import {Person} from './person.ts';
let person = new Person();
console.info(person.name);
export class Person {
public name: string = 'rajkishor09';
}