Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
backbone debug
var $bbSetElement = Backbone.View.prototype.setElement;
Backbone.View.prototype.setElement = function setElement(element) {
if (this.el && this.el !== element) {
delete this.el.$bbView;
const domElem = element.jquery ? element[0] : element;
domElem.$bbView = this;
domElem.setAttribute(`data-backbone-view`, `true`);
return $bbSetElement.apply(this, arguments);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.