Skip to content

Commit

Permalink
Update docs to new API
Browse files Browse the repository at this point in the history
  • Loading branch information
Malte Ubl committed Mar 1, 2010
1 parent 2a8e155 commit 58b1dc8
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions README.md
Expand Up @@ -36,16 +36,17 @@ The asynchronous features come in handy when you

var te = require("../lib/asyncEJS").Engine();

var template = te.template("template.t.html");
te.template("template.t.html", function () {

var templateResponse = template(paras);
var templateResponse = template(paras);

templateResponse.addListener("body", function (chunk) {
sys.print(chunk);
});
templateResponse.addListener("body", function (chunk) {
sys.print(chunk);
});

templateResponse.addListener("complete", function () {
sys.puts("COMPLETE")
templateResponse.addListener("complete", function () {
sys.puts("COMPLETE")
});
});

## Templates
Expand Down Expand Up @@ -106,7 +107,7 @@ will be served from the current working directory.
After you instantiated a template engine use the `template` method to create a template
function.

var template = te.template("template.t.html");
te.template("template.t.html", function (template) { ... });

Executing the template function with `paras` will return a templateResponse. The `paras` are
accessible as `ctx` variable inside the template.
Expand Down

0 comments on commit 58b1dc8

Please sign in to comment.