Skip to content

Instantly share code, notes, and snippets.

@chenxsan
Created January 10, 2014 12:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chenxsan/8351314 to your computer and use it in GitHub Desktop.
Save chenxsan/8351314 to your computer and use it in GitHub Desktop.
Handlebars.js 预编译的结果
(function () {
var template = Handlebars.template,
templates = Handlebars.templates = Handlebars.templates || {};
templates['person'] = template(function (Handlebars, depth0, helpers, partials, data) {
this.compilerInfo = [4, '>= 1.0.0'];
helpers = this.merge(helpers, Handlebars.helpers);
data = data || {};
var buffer = "",
stack1, helper, functionType = "function",
escapeExpression = this.escapeExpression;
buffer += "<table>\n <tr>\n <td>This is ";
if (helper = helpers.firstname) {
stack1 = helper.call(depth0, {
hash: {},
data: data
});
} else {
helper = (depth0 && depth0.firstname);
stack1 = typeof helper === functionType ? helper.call(depth0, {
hash: {},
data: data
}) : helper;
}
buffer += escapeExpression(stack1) + " ";
if (helper = helpers.lastname) {
stack1 = helper.call(depth0, {
hash: {},
data: data
});
} else {
helper = (depth0 && depth0.lastname);
stack1 = typeof helper === functionType ? helper.call(depth0, {
hash: {},
data: data
}) : helper;
}
buffer += escapeExpression(stack1) + "</td>\n </tr>\n</table>\n";
return buffer;
});
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment