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
Did you know?
JavaScript on a page runs with the privileges of that origin. One altered library, tag manager, or snippet can read inputs, change what people see, and call your APIs as the user.
Security insights from Cside
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#