Mustache – Check Boolean object property within object array


Actually I’m using mustache-express, and I know that I can use conditionals like: {{^isFalse}} and {{#isTrue}}, this stuff is working fine, but my problem is:

I send an object array to template and list their properties with {{prop1}}{{prop2}}

My object has a Boolean property that is only true for the first object, and I need to grab another property from this object and set as audio element source, which I couldn’t do, despite this snippet. Probably I’m missing something… But this is what I tried with no success:

Access the Boolean property directly (as he did):

<audio hidden src="{{myPath}}"></audio>

Access within the array call, as I’m doing with my list:

<audio hidden src="{{myPath}}"></audio>

Is there any way I can do this without having to create a separate object?


The answer was:

<audio hidden src="{{myPath}}"></audio>

Answered By – nanquim

This Answer collected from stackoverflow, is licensed under cc by-sa 2.5 , cc by-sa 3.0 and cc by-sa 4.0

Leave a Reply

(*) Required, Your email will not be published