I\'m trying to use two models in one view, and template using both of them. I\'m working with Marionette. Here is me initialization of the view:
main_app_layout.
You can override the serializeData
method on your view and have it return both models' data:
APP.Views.HeaderView = Backbone.Marionette.ItemView.extend({
// ...
serializeData: function(){
return {
model1: this.model.toJSON(),
model2: this.options.model2.toJSON()
};
}
});
Then your template would look like this: