steal-typescript
Use StealJS to load TypeScript modules — no build required. Here are the steps to get started:
steal
and steal-typescript
.
Install npm install --save steal steal-typescript
package.json
to add steal-typescript
as a steal
plugin
Update your "steal": {
"plugins": [
"steal-typescript"
]
}
index.html
file:
Create your <!doctype html>
<html>
<body>
<script src="./node_modules/steal/steal.js" main="index.ts"></script>
</body>
</html>
index.ts
file:
Create your class Greeter {
constructor(public greeting: string) { }
greet() {
return "<h1>" + this.greeting + "</h1>";
}
};
var greeter = new Greeter("Hello, world!");
document.body.innerHTML = greeter.greet();
Load your app in a browser
That's it. Your app is ready to go.