Quantcast
Channel: Ionic Forum - Latest topics
Viewing all articles
Browse latest Browse all 70612

Logic in HTML template

$
0
0

@lawlesscreation wrote:

Hi all, I'm looking for some best practice advice on how to handle some basic logic for HTML rendering. To give a simple example, if I wanted to show a welcome message when a variable returns true:

{% if showWelcome == true %}
<h2>Welcome!</h2>
{% endif %}

Apologies for the Twig code example, I just have no idea of the syntax to do logic in an Ionic HTML templates. Reading the docs, it looks like I could pass an entirely new templateUrl but that seems a little overkill if the differences are minor.

Is there a template engine for logic like this in the HTML template? Would it be best to pass an entirely different templateUrl? Or is there something I'm missing?

Thanks!

Posts: 5

Participants: 3

Read full topic


Viewing all articles
Browse latest Browse all 70612

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>