backbone.debug icon indicating copy to clipboard operation
backbone.debug copied to clipboard

Preserve original constructor name

Open ghost opened this issue 11 years ago • 0 comments

This improves the debugging output since you can display the class name instead of just Model/View/Collection by adding a named constructor like this:

constructor: function MyModel() {
  Backbone.Model.apply(this, arguments);
 },

The debug output looks more like:

[instance] Model: MyModel:c6

This also improves compatibility with the Backbone-Debugger chrome extension.

ghost avatar Oct 10 '13 20:10 ghost