backbone.namedconstructor
Give your Backbone object a named constructor, so you can make sense of it in the dev tools console.
Works with AMD, CommonJS and browser globals.
Installation
$ npm install backbone.namedconstructor
Example
If you set a constructorName
property, this will be used to name the constructor
:
var Backbone = ;; var Model = BackboneModel;console;// 'Foo'
So, instead of:
You'll see:
Tests
$ npm test
Credit
The basis for this module was this great Stack Overflow answer given by Dan Malcolm. Cheers!
License
MIT