Handlebars.Net icon indicating copy to clipboard operation
Handlebars.Net copied to clipboard

Conditional block does not work within a partial

Open sebasijan opened this issue 4 years ago • 1 comments

Describe the bug

I have the following partial registered

var partialSource = "{{#if ClientCode}}IT EXISTS{{else}}IT IS NOT HERE{{/if}}";
Handlebars.RegisterTemplate("LinkToCompany", partialSource);

And I pass in my entity

{
    ClientCode = "TEST"
}

with this template

{{> LinkToCompany Entity}}

Expected behavior:

I expect that to render as IT EXISTS, since the entity contains a ClientCode property.

sebasijan avatar Jul 06 '21 11:07 sebasijan

Hello @sebasijan Can you please provide a test that covers your problem?

oformaniuk avatar Jul 07 '21 19:07 oformaniuk