Mustache : how to keep And condition in mustache

90 views Asked by At

Below is how i am using with Mustache.If source is there i am showing {{#flag_sour}} data, if destination is there i am showing {{#flag_dest}} data.

{{#onwardfl}}                            
{{#flag_sour}}                           
<div class="col-xs-12 flightbooking noleftpadding">
<div class="col-xs-12">
<p  style="color:#165391;">  this is not a direct flight </p>
</div>

</div>
{{/flag_sour}}
{{#flag_dest}}                           
<div class="col-xs-12 flightbooking noleftpadding">
<div class="col-xs-12">
<p style="color:#165391;">  this is not a direct flight </p>
</div>

</div>
{{/flag_dest}}
{{/onwardfl}}

if {{#flag_sour}} and {{#flag_dest}} are both there i want to show only one message this is not a direct flight. How can i do this with mustache.

1

There are 1 answers

0
Kristian Vitozev On

Mustache is "logic-less" template engine, so if you are using Model-view-controller architecture, it would be better to solve your problem in your controller.

That's the idea of logicless templating.