Make {{#if foo}} handle empty Arrays
This commit is contained in:
@@ -91,7 +91,7 @@ Handlebars.registerHelper('each', function(context, fn, inverse) {
|
||||
});
|
||||
|
||||
Handlebars.registerHelper('if', function(context, fn, inverse) {
|
||||
if(context === false || context == null) {
|
||||
if(!context || context === []) {
|
||||
return inverse(this);
|
||||
} else {
|
||||
return fn(this);
|
||||
|
||||
Reference in New Issue
Block a user