question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Is #if working at all?

See original GitHub issue

Hi,

Just wanted to know if #if is implemented at all?

{{#if 1}}
   <h1>TEST TRUE</h1>
{{/if}}
{{#if 0}}
   <h1>TEST FALSE</h1>
{{/if}}

If not, could anyone point me in the direction of where it should be implemented?

I tried to implement it by writing my own helper, but then I’m missing a way to call the renderer again. Example:

Handlebars.RegisterHelper("section", (writer, context, parameters) =>
{
   var section = context as ReportSection;
   if (section == null) return;
   switch (section.Type)
   {
      case ReportSectionType.Frontcover:
         writer.WriteSafeString(????);  //How do I make the writer "continue" to render the inner template?
         break;
   }
});

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
ischyruscommented, May 12, 2022

If it helps someone in the future, #if does not work well with dynamic objects. Instead try using ExpandoObjectConverter and ExpandoObject.

0reactions
rexmcommented, Jan 20, 2017

Closing this due to inactivity.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Opinion | Jobs for All! But Is It Working for All?
Here, we ask whether we work to live or live to work. Can we achieve true democracy without considering economic democracy? Can economic...
Read more >
How some people get away with doing nothing at work - Vox
Vox granted him anonymity to speak for this story for obvious reasons, as we did all of the workers interviewed.
Read more >
Extreme Jobs: The Dangerous Allure of the 70-Hour ...
Across the economy, there are high-earning professionals whose work has become all consuming. The outrageous hours they put into their careers are matched...
Read more >
35% of workers who can work from home now do this all ...
About a third of workers with jobs that can be done remotely are working from home all the time, according to a new...
Read more >
I've been working from home for 10 years. Here are the 6 ...
Don't make these 6 biggest mistakes if you're working from home, says guy who's done it for 10 years · 1. Working in...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found