1

In handlebars how can I say for example:

{{#if view_type == "medium"}}
    // Do something
{{/if}}

Not simply :

{{#if view_type}}
    // Do something
{{/if}}

Im am using it in NodeJs

Im looking for solution without registerHelper()

1 Answers1

1

There's no solution without a new helper. What I would suggest you is to switch from handlebars to Swig, which, the syntax, is pretty similar.

http://paularmstrong.github.io/swig/docs/

It is easily implementable.

If you are trying to do an IF I guess you are at the beginning of your project so it could be an option.

DevAlien
  • 2,456
  • 15
  • 17