Closed luis-cortina closed 3 years ago
Both #if
and #unless
accept only one parameter that they will try to evaluate to a boolean result.
You need to write your own block helper for such a case
Have a look at the example over at Handlebars.Net https://github.com/Handlebars-Net/Handlebars.Net#registering-block-helpers Their example is actually exactly what you want 🙂
Registering the block helper is slightly different because it's going through the helper methods of this library
It is not mentioned in the docs, but there is a also method AddHandlebarsBlockHelpers()
https://github.com/TrackableEntities/EntityFrameworkCore.Scaffolding.Handlebars#handlebars-helpers-and-transformers
Thanks @Leosori for answering this question.
First time I hear of handlebars and most solutions out there are js related.
I want to exclude a property from rendering if it has a certain name. I was doing this, but not working. Any ideas?
{{#unless property-name TenantId}}