mirror of
https://github.com/jashkenas/backbone.git
synced 2026-04-08 03:00:26 -04:00
creating a model should set its attribute
This commit is contained in:
@@ -398,6 +398,7 @@
|
||||
if (!(model instanceof Backbone.Model)) model = new this.model(model);
|
||||
model.collection = this;
|
||||
var success = function(model, resp) {
|
||||
model.set(resp.model);
|
||||
model.collection.add(model);
|
||||
if (options.success) options.success(model, resp);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user