Incorrect model hierarchy when setting 2-dimensional array
Dema opened this issue · 2 comments
Dema commented
Here is the problem:
test("setting nested array to existing model",2,function(){
var model = new Backbone.DocumentModel({items:[]});
model.set('items', [[1],[2]]);
equal(model.get('items.0') instanceof Backbone.Model, false);
equal(model.get('items.0') instanceof Backbone.Collection, true);
});
both tests failed
It actually creates Backbone.Model object with keys 0 and 1. Is this an expected behaviour?
Dema commented
Thanks!