icereval / backbone-documentmodel

A plugin to create entire Document structures with nested Backbone.js Models & Collections with deep model references and event bubbling.
MIT License
66 stars 8 forks source link

Instantiation of nested Models fails if nested attributes have their own IDs #20

Open prg opened 10 years ago

prg commented 10 years ago

With an object like this:

var obj = {
  id: 'a1',
  foo: {
    id: 'b2',
    bar: 'baz'
  }
}

instantiation of foo seems to fail, it's simply omitted and the top-level Model doesn't have the expected attribute (e.g. model.get('foo') returns undefined).

As far as I can tell, it's this line's fault.

malte-wessel commented 9 years ago

+1

Sefarth commented 9 years ago

+1