我真的不明白Moustache/Hogan.js的partials/template继承。如定义here和here你似乎必须有两个不同的文件才能工作。我用它作为我的(客户端)页面如下:部分/模板继承在Mustache中如何工作?
<template id="server-template"> {{#servers}} <b>some html and {{> some other which I dont understand how to use}}</b> {{/servers}} </template> <template id="room-template"> I want this in up there. (in the "partials" tag) </template>
感谢您的帮助。我编译他们这样的:
var source = $('#room-template').html(), compiled = Hogan.compile(source) $('#main').html(compiled.render(data))
是,即使可能吗?
非常感谢:) – kurtextrem