Skip to content

Instantly share code, notes, and snippets.

@rutvij-pandya
Created July 20, 2014 10:43
Show Gist options
  • Select an option

  • Save rutvij-pandya/1f46d98f2525d305ddba to your computer and use it in GitHub Desktop.

Select an option

Save rutvij-pandya/1f46d98f2525d305ddba to your computer and use it in GitHub Desktop.
// ======= You can try below example using -
// http://trymustache.com/ ======
// == Just Copy-Paste below code in "Mustache Template section == "
{{#content}}
<div style="width: 100%;">
{{title}}
</div>
<div style="width: 100%;">
{{#data}}
<div style="padding: 4px, 2px; text-align: center;">
<div style="width: 40px; height: 40px; background:{{value}};">
</div>
<span>{{display_name}}</span>
</div>
{{/data}}
</div>
{{/content}}
// == And Copy-Paste below code in "JSON Feed section == "
{
"content": {
"title": "Select Color",
"data": [
{
"id": 1,
"value": "#121212",
"display_name": "color 1"
},
{
"id": 2,
"value": "#a5a5a5",
"display_name": "color 2"
},
{
"id": 3,
"value": "#654321",
"display_name": "color 3"
},
{
"id": 4,
"value": "#123456",
"display_name": "color 4"
}
]
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment