Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

how to use handlebars.registerhelper if null

Handlebars.registerHelper('ifEmptyOrWhitespace', function (value, options) {
    if (!value) { return options.fn(this); }
    return value.replace(/s*/g, '').length === 0
        ? options.fn(this)
        : options.inverse(this);
});
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #null
ADD COMMENT
Topic
Name
8+3 =