1
couchdb에서 첨부 파일 이름을 렌더링하십시오. 변환없이 핸들 막대 또는 콧수염 템플리트를 사용하십시오.변환하지 않고 couchdb에서 첨부 파일 이름을 렌더링하십시오.
{
"_id":"123",
"_attachments":{
"evil.jpg":{
"content_type":"image/jpeg",
"revpos":32,
"digest":"md5-CKtT5WWRLkmGDD3/DhK6FQ==",
"length":41915,
"stub":true
}
}
}
나는 이것이 Getting key's in handlebar과 중복 된 것으로 생각합니다. 핸들의
// based on the `#each` helper, requires jQuery (for jQuery.extend)
Handlebars.registerHelper('each_hash', function(context, options) {
var fn = options.fn, inverse = options.inverse;
var ret = "";
if(typeof context === "object") {
for(var key in context) {
if(context.hasOwnProperty(key)) {
// clone the context so it's not
// modified by the template-engine when
// setting "_key"
var ctx = jQuery.extend(
{"_key":key},
context[key]);
ret = ret + fn(ctx);
}
}
} else {
ret = inverse(this);
}
return ret;
});