我在对具有分支详细信息的jsrender模板的ajax响应中发送对象branchData。
branchData: Array(2)
0: {name: "M13", displayName: "Abc", url: null}
1: {name: "M01", displayName: "Xyz", url: null}
与
var helper = {
branchHoursText: "Teléfono y Horarios"
phoneText: "Teléfono"
hoursText: "Horario"
closedText: "CERRADA"
inventory: {M01: "0", M13: "1", M11: "0", M10: "0", M21: "0"}
}
$(".branchInfo").html(branchTemplate.render(response, helpers));
我正在模板中使用以下代码。
{{for branchData}}
{{:displayName}}
{{props ~inventory}}
{{/props}}
{{/for}}
如果branchData.name == ventory.key],我想显示该分支的库存。有点像
{{props ~inventory}} {{if key === name}} {{>prop}} {{/if}}} {{/props}}
请帮助!
我正在以ax的形式发送对象branchData到具有分支详细信息的jsrender模板。 branchData:Array(2)0:{名称:“ M13”,displayName:“ Abc”,URL:null} 1:{name:“ M01”,displayName:“ Xyz”,...