Compiles TypeScript in Diet templates to JavaScript and caches the result.
To register the plugin you have to import diet_typescript;
in your application.
import vibe.d;
import diet_typescript;
//...
void hello(HTTPServerRequest req, HTTPServerResponse res)
{
res.render!"typescript.dt"();
}
Now you can use the :typescript
textfilter in your diet files.
doctype html
html
head
title Hello, TypeScript
body
:typescript
class HelloWorld {
constructor(id: number, name: string) {
console.log("Hello world!");
}
}
var typing = new TypeCheckDemo("hello", 1);
See example for a complete vibe.d app.