把手返回空字符串

时间:2014-05-09 17:30:22

标签: templates handlebars.js

我无法弄清楚我的模板有什么问题。 数据:

{
"paquete":[
    {
    "imagen": "http://origincache-prn.fbcdn.net/10254101_784753068202443_129112442_n.jpg",
    "id_local":1,
    "local":"Güelita",
    "texto":"Vermouth en Güelita",
    "likes": 42
    },
    {
        "imagen": "http://origincache-prn.fbcdn.net/10254101_784753068202443_129112442_n.jpg",
        "id_local":1,
        "local":"Güelita",
        "texto":"Vermouth en Güelita",
        "likes": 42
    },
    {
        "imagen": "http://origincache-prn.fbcdn.net/10254101_784753068202443_129112442_n.jpg",
        "id_local":1,
        "local":"Güelita",
        "texto":"Vermouth en Güelita",
        "likes": 42
    }
]
}

模板:

{{#each paquete}}
    <div class="articulo">
        <div class="foto"><img src="{{this.imagen}}"></div>
        <div class="texto">{{this.texto}} en {{this.local}}</div>
    </div>
{{/each}}

这只返回一个空字符串。请帮忙!

1 个答案:

答案 0 :(得分:0)

尝试删除“this”。并只是把imagen,texto和本地