backbone.epoxy
backbone.epoxy copied to clipboard
Nested model bindings
Hi,
I have this model : { a: "value1", b: "value2", nestedModel: (Backbone.Model) { c: "value3", d: "value4" } }
How bind the main model and the nested model into the same view ?
I can't access to the nested model in the bindingSources declaration :(
Thank you !
I pretty much need this feature too. There is way around though. You need to use bindingSources to bind into nested model.
Like this bindingSources: function() { return { nestedModel: function () { return this.model.get("nestedModel"); }.bind(this) } }
Don't forget to add: _.bindAll(this, "bindingSources"); in constructor.
Then access in binding: '#foo': 'text: nestedModel_attribute'