【发布时间】:2011-01-30 09:50:54
【问题描述】:
我正在寻找使用Mustachejs 和Nodejs 的示例
这是我的示例,但它不起作用。 Mustache 未定义。
我正在使用 master 分支中的 Mustachejs。
var sys = require('sys');
var m = require("./mustache");
var view = {
title: "Joe",
calc: function() {
return 2 + 4;
}
};
var template = "{{title}} spends {{calc}}";
var html = Mustache().to_html(template, view);
sys.puts(html);
【问题讨论】:
标签: node.js serverside-javascript