blittle / backbone-nested-models

Backbone Nested Models
86 stars 28 forks source link

Reference to parent should be available at initialisation #6

Closed johtso closed 11 years ago

johtso commented 11 years ago

Currently parent is added to the newly created collection/model as a property, but this means that there is no way to know what the parent is within the initialize method.

Maybe just adding parent to the options is a reasonable solution?

blittle commented 11 years ago

@johtso What are you trying to do with the parent reference in the initialize method? I am weary about adding a reference as a part of the options within initialize because the parent model has not finished constructing, and doesn't even have a reference to the child relation at that point in time. I could add it, but just be aware that the model is not yet finished initializing.

blittle commented 11 years ago

Added _parent attribute the options object in v0.5.0