This repository was archived by the owner on Apr 4, 2019. It is now read-only.
This repository was archived by the owner on Apr 4, 2019. It is now read-only.
How to define an “if else” helper #471
Open
Description
Hi, I've recently found this project and I think it's an interesting alternative to Handlebars.
I'm testing some stuff to see how it works, but I can't find the way to set an “if else” helper. Normally in Handlebars this helper is already defined, but its documentation still shows you how it works.
Handlebars.registerHelper('if', function(conditional, options) {
if(conditional) {
return options.fn(this);
} else {
return options.inverse(this);
}
});
However, in HTMLBar the API to define helpers is different. You invoke this.yield();
instead. But I can't find a way to tell the yield method to call the else block.
Am I doing something wrong, or is this feature not supported?
Metadata
Metadata
Assignees
Labels
No labels
Activity