Is it possible to use a nested object as the id attribute in Backbone?
For e.g. something like,
var MyModel = Backbone.Model.extend({
defaults : {
'info': {
'name': ""
},
},
idAttribute: "info.name"
}
BTW, the above doesn't work as an ID, I added it here just to give an idea of what I was trying to achieve.
TIA
{info: { ... } }object) in yourdefaults, use adefaultsfunction instead of an object literal. Thedefaultsare shallow copied so you're going to end up changing the prototype'sdefaultsand wonder why all your models have changed.