2

In the example below:

{{#content}}
        <tr>
        {{#show}}
        <td>{{ID}}</td><td>{{fieldname1}}</td><td>{{fieldname2}}</td>
        {{/show}}
        </tr>
{{/content}}

is it also possible to show the field/keynames themselves of the content array? Thus showing "fieldname1" and "fieldname2" instead of the values in these fields/keys.

Thanks

The Code Buccaneer
  • 765
  • 1
  • 9
  • 19

2 Answers2

2

No, Mustache.js cannot do this. You'll need to write a helper using something like Handlebars as outlined in this similar question

Community
  • 1
  • 1
maxbeatty
  • 8,598
  • 3
  • 31
  • 36
0

use : {{#each topLevelObject}}{{.}}{{/each}}