I want to use mustache to template some data.
The data to template is like :
var data = {
"lib" : "L1",
"group" :
{"echelle" : "Bassin"}
}
I try to use mustache :
var templateResult = "<tr><td><p>{{lib}}</p></td><td><p>{{>group}}</p></td></tr>";
var partials = {"group" : "{{#group}}<td><p>{{echelle}}</p></td>{{/group}}"}
$("#result_indic_table").append(Mustache.render(templateResult, data, partials));
And it just doesn’t work… What am i doing wrong?
I’ve solved my problem…
the data wasn’t like I thought :
So the template should look like :
And it’s done.