e.g.
var Mailbox = Backbone.Model.extend({
initialize: function() {
this.messages = new Messages;
this.messages.url = '/mailbox/' + this.id + '/messages';
this.messages.on("reset", this.updateCounts);
},
...
});
var inbox = new Mailbox;
// And then, when the Inbox is opened:
inbox.messages.fetch({reset: true})
But not quite sure how to get it to work with fetcher && model/collectionStore. If we just fetch the collection, the model is not stored or retrieved. If we fetch the model, the collection data is not stored.
I am also running into similar problems if we are just using one off Backbone models. For example if I create a model in the controller and use that to fetch data and create a new collection. Then it is not placed in the store and hydrated in the model.
Is there a pattern or example I can follow to 'artificially' store models or collections?
Thanks!
Jon