Log within handlbars
When needing to debug within a handlebars template I find it useful to be able to log straight from the template.
first define a helper
Handlebars.registerHelper('HB_log', function(context, options) {
console.log(context);
});
then in your template just call it with what you would like to log
{{HB_log this}}
Written by Leigh Quince
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Javascript
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#