I'm trying to access the id of this element sent by json in handlebars.js
{
"status":"success",
"message": {
"message":"sdasdasasd",
"type":"photo",
"post_id":55,
"title":"",
"description":"",
"url":"",
"image":"",
"code":"",
"provider":"",
"photo": {
"http:\/\/timeline.dev\/storage\/app\/public\/vdjkelly\/timeline_SzfkoDzMWc.jpg":"http:\/\/timeline.dev\/storage\/app\/public\/vdjkelly\/timeline_SzfkoDzMWc.jpg",
"http:\/\/timeline.dev\/storage\/app\/public\/vdjkelly\/timeline_qm7sq7RY1K.jpg":"http:\/\/timeline.dev\/storage\/app\/public\/vdjkelly\/timeline_qm7sq7RY1K.jpg"
}
}
}
The code that I have like this
@{{#each photo}}
<li class="grid">
<div class="posted-photo">
<div class="photo">
<div class="fphoto-item">
<a class="ShowStatus" data-id="@{{post_id}}" href="#" data-lightbox="lightbox@{{post_id}}">
<img src="@{{this}}" class="imgpreview" id="@{{post_id}}" rel="@{{post_id}}">
</a>
</div>
</div>
</li>
@{{/each}}
and even then you do not access the post_id
The code of my js is the following:
var template = render_template('#send-photo', {
'message': response.message.message,
'type': response.message.type,
'photo': response.message.photo,
'post_id': response.message.post_id
});