siva
siva

Reputation: 7

Mustache : how to keep And condition in mustache

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.

Upvotes: 0

Views: 83

Answers (1)

Kristian Vitozev
Kristian Vitozev

Reputation: 5971

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.

Upvotes: 1

Related Questions