How can i pass the model's attribute to collectionOptions? When i try to pass param0 like that, then this
is referenced to window
instead to MyModel
instance:
var MyModel = Backbone.RelationalModel.extend({
defaults: {
param0: null,
},
relations: [
{
type: Backbone.HasMany,
key: 'others',
relatedModel: 'OtherModel',
collectionType: 'OtherModelCollection',
collectionOptions: {param0: this.get('param0')}
}
]
});