couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Aliaksandr Barysiuk <a.barys...@gmail.com>
Subject Couchdb and Handlebars
Date Tue, 09 Oct 2012 15:08:01 GMT
Hello,

I faced with issues when i have tried to use Handlebars (http://handlebarsjs.com/) in my show
function. It seems it's 
CommonJS compliant but following simple example fails...

function(doc, req) {

     var Handlebars = require('lib/handlebars');
     var source = "<div>{{user}}</div>"
     var template = Handlebars.compile(source);
     return template( { user:"John" } );
}

...with error:

{"error":"render_error","reason":"function raised error: (new TypeError(\"Handlebars.compile
is not a function\", \"\", 
4) ...

log(Handlebars) prints "Log :: {"parser":{"yy":{}}}".

So the problem is to find how to create Handlebars instance. Could somebody advise?

Thank you

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