mustache Questions
3
Solved
In my Mustache template, I would like to comment a couple of lines, but I am unable to do it. I am still getting the comments displayed in HTML. What is the correct way to add comments? Anyone can ...
Antonetta asked 22/10, 2013 at 12:27
4
Solved
I want to implement the following logic with Mustache:
{{#if users.length > 0}}
<ul>
{{#users}}
<li>{{.}}</li>
{{/users}}
</ul>
{{/if}}
// eg. data = { users: ['To...
2
Solved
I have an array like this in JavaScript:
[name: "myname", text: "<p>my html text</p>"]
Now when I use this in my Mustache template it displays the text as:
<p>my html text<...
Opaline asked 11/10, 2012 at 7:32
5
I use Handlebars .NET for my mail templates so i generate template at server side width ASP.NET MVC. I need a comparision like this. But it doest't work? What can I do?
//Product.ProdType is a en...
Naturalism asked 19/6, 2015 at 8:55
5
Solved
How does one use a literal "{{" in a Mustache template?
On a side note, if I'm using custom tags, like <% and %>, is there a way to write "<%"?
Theoretically, I could use different tags...
3
Solved
I am trying to template the following array of objects:
var arr = [{name:"Ryan Pays", url:"http://www.ryanpays.com"}, {name:"foo", url:"http://www.google.com"}];
I convert that array to an objec...
Tacket asked 13/1, 2012 at 18:0
5
Solved
I'm using mustache. I'm generating a list of notifications. A notification JSON object looks like:
[
{
"id": 1364,
"read": true,
"author_id": 30,
"author_nam...
Lovesick asked 18/12, 2011 at 0:18
5
I'm trying to generate a JSON file with mustache with the following template:
{
"name": "{{customer_info.first_name}}",
"email": "{{contact_info.email}}",
"campaign": {
"campaignId": "{{contac...
3
I'm following the Spring Security reference, and I've got redirection to a custom login page working as described in section 3.3. However, I'm not sure how to get the CSRF token in Mustache (all th...
Symmetrize asked 16/10, 2014 at 5:54
1
I have a complex system that has a template. Unfortunately, I can't find where the template is being called. I would like to know all of the variables passed to the template when it was rendered. I...
Archaimbaud asked 15/9, 2014 at 20:52
5
Solved
When I googled about React.js what I got is: React.js is a Framework that is used to create user interfaces. If a particular part of the website is frequently updated that means we can use react. B...
Fortuitous asked 26/2, 2016 at 5:14
2
Solved
I have this very simple structure which can not be parsed with mustache and always returns:
Unclosed section: selected
<ul id="source">
{{#recomms}}
<li>
<select>
{{#sizes}}...
Grilled asked 10/12, 2012 at 10:31
3
Solved
I have a scenario where I am getting {{isdone}} value with Boolean data.
I want to be printed as "pending" for false value and "Done" for true.
I'm using below code, Which isn't working.
{{isdon...
7
Solved
I have started using mustache.js and so far I am very impressed. Although two things puzzle me. The first leads on to the second so bear with me.
My JSON
{"goalsCollection": [
{
"Id": "d5dce10...
Landin asked 8/4, 2012 at 17:51
3
Solved
I'm newbie to mustache and was wondering how to iterate over HashMap using mustache given this Map
Map mapA = new HashMap();
mapA.put("key1", "element 1");
mapA.put("key2", "element 2");
mapA.put...
7
Solved
I'm trying to template a template, like below:
{{{
{
"name" : "{{name}}",
"description" : "{{description}}"
}
}}}
{{{debug this}}}
<h1>{{name}}</h1>
Where I want to triple b...
Deflexed asked 19/12, 2012 at 2:17
0
I'm using mustache templates in vscode and trying to find a formatter for the mustache templates. So far I have found pretty formatter, mustache template, and mustache, but none of them seem to do ...
Andean asked 30/9, 2021 at 4:42
2
Solved
I have a simple JSON file as shown below:
{
"products": [
{
"title": "United Colors of Benetton Men's Shirt",
"description": "Cool, breezy and charming – this solid green shirt from United Col...
Archibold asked 2/4, 2014 at 18:37
3
Is there a solution where you could do the following?:
my-template.mustache
Hello {{name}}!
index.ts
import { readFileSync, writeFileSync } from 'fs';
import * as Mustache from 'mustache';
ex...
Nameless asked 21/9, 2017 at 22:52
9
Major differences I've seen are:
Handlebars adds #if, #unless, #with, and #each
Handlebars adds helpers
Handlebars templates are compiled (Mustache can be too)
Handlebars supports paths
Allows us...
Swinford asked 11/5, 2012 at 17:15
2
I have a variable ({{title}}) which contains an apostrophe. Mustache escapes this as &#39;.
However, the following template results in a JavaScript error (Expected token ')'):
<a href="jav...
Arad asked 14/5, 2014 at 18:42
19
Solved
I am using the Mustache templating library and trying to generate a comma separated list without a trailing comma, e.g.
red, green, blue
Creating a list with the trailing comma is straightforw...
Hamford asked 24/5, 2011 at 17:30
6
Solved
My object looks like this:
['foo','bar','baz']
And I want to use a mustache template to produce from it something like this:
"<ul><li>foo</li><li>bar</li><li>...
Grassofparnassus asked 29/6, 2011 at 5:53
5
I need to pick a Mustache rendering engine for a Scala project of mine. Seems like the only two choices are Mustache-Java and Scalate? Are there any comparisons? Which one is the more stable/perfor...
Tannin asked 17/1, 2012 at 3:23
2
I haven't found a decent answer to this yet, so I figure I'll try.
Use-case. I have HTML files that will require 2 passes of processing. One of them has static variables in it, but I need them repl...
Splitting asked 8/3, 2021 at 16:36
1 Next >
© 2022 - 2025 — McMap. All rights reserved.