squirrellyjs / squirrelly

Semi-embedded JS template engine that supports helpers, filters, partials, and template inheritance. 4KB minzipped, written in TypeScript ⛺
https://squirrelly.js.org
MIT License
599 stars 82 forks source link

Does Squirrelly support conditional operators? #112

Closed pbrianmackey closed 5 years ago

pbrianmackey commented 5 years ago

Is there support for this kind of logic:

{{if(options.somevalue === 1 && options.someothervalue === 1)}}
Display this
{{#else}}
Display this
{{/if}}

Handlebarsjs was my first try and it doesn't support it natively. I read through the documentation and could not find the answer to this.

nebrelbug commented 5 years ago

Hi @pbrianmackey, thanks for the question! There is support for conditionals, and they have exactly the syntax that you wrote down.

Here's an example: https://runkit.com/nebrelbug/squirrelly-with-conditionals

Does this answer your question?