afeld / backbone-nested

A plugin to make Backbone.js keep track of nested attributes - looking for maintainers! https://github.com/afeld/backbone-nested/issues/157
https://afeld.github.com/backbone-nested/
MIT License
445 stars 83 forks source link

The plugin should return the NestedModel object instead of Backbone. (CommonJS, AMD) #150

Open achinaou opened 8 years ago

achinaou commented 8 years ago

When I require("backbone-nested-model") it returns the Backbone object but it should return the NestedModel object so you can instantiate or extend from it a new NestedModel object.

This is how it works now:

var Backbone = require("backbone-nested-model");

var User = Backbone.NestedModel.extend({
});

var user = new User();

This is how it should be:

var NestedModel = require("backbone-nested-model");

var User = NestedModel.extend({
});

var user = new User();
achinaou commented 8 years ago

I can create a PR but it can be dangerous because it's a breaking change.

just-boris commented 8 years ago

That's true. Ask @afeld pay attention for this.