Open mmacaula opened 10 years ago
Hey @mmacaula, I ran into a similar issue over at #90. I'm also not sure my fix there is 100% the right one. Can you test your use case with that branch and see if you get the expected behavior?
Basically it passes {silent: false}
down to child collections during initialization so that they get the proper add
events. In the meantime in my app I've just been putting {silent: false}
in the options whenever I fetch or init a model or collection with children.
Thanks @lukekarrys yes I think this definitely being addressed there. I'll close this one assuming a solution will be found in that issue
I have a child collection declared in a State. RequireBin runnable code here. I'd like to be able to initialize my collection with what is being inflated from the parent but can't seem to find a hook into doing it. I'd expect either the models on
initialize
, or areset
or a lot ofadd
events, but State initializes an empty collection first and then silently resets the collection with the actual passed in models.Is there a way to change this so I can hook into my child collection's initialize? Currently I'm stuck doing something like this:
My initial thought is to not pass
{silent: true}
when the child is first populated viareset
, but I'm not sure how that might affect other tests. I'd be happy to contribute (with tests!) a solution if there is a need for a code change. Thanks and awesome job with Ampersand!