Skip to content

Instantly share code, notes, and snippets.

@kitmenke
Last active December 13, 2015 18:18
Show Gist options
  • Save kitmenke/4953860 to your computer and use it in GitHub Desktop.
Save kitmenke/4953860 to your computer and use it in GitHub Desktop.
Custom JsRender debug tag
/**
* Custom JsRender debug tag
* Log a message and an object to the console.
* Usage: {{debug #parent message='Inside the for loop'/}}
**/
$.views.tags({
debug: function(obj) {
var props = this.props;
// output a default message if the user didn't specify a message
var msg = props.message || 'Debug:';
console.log(msg, obj);
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment