incubator-couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From IOMATIX <ioma...@yahoo.com>
Subject Mustache Differencing Sections
Date Thu, 09 Dec 2010 04:08:54 GMT
The example from https://github.com/janl/mustache.js documentation does not seem 
to work in Couchdb.  Any clues?
function(head, req) {
    start({
        "headers": {
            "Content-Type": "text/html"
        }
    });
var mustache = require("lib/mustache");var view = {a_object: {title: 'this is an 
object',description: 'one of its attributes is a list',a_list: [{label: 
'listitem1'}, {label: 'listitem2'}]}};var template = 
"{{#a_object}}<h1>{{title}}</h1><p>{{description}}</p><ul>{{#a_list}}<li>{{label}}</li>{{/a_list}}</ul>{{/a_object}}";return
 mustache.to_html(template,view);
}

Outputs:
<h1></h1><p></p><ul></ul>
This is all related to my original question below that I realize is overly 
complicated.
Thank you,
/ Jeff  


      
Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message