Skip to content


Subversion checkout URL

You can clone with
Download ZIP


Access nested model attribute #2

pheuter opened this Issue · 9 comments

5 participants


It doesn't seem possible to bind a nested model attribute to a dom element.

For example:

      modelAttr: ''

@pheuter I think you can manage to walk that attribute in the format callback before it is updated to the view element:

bindings: {
  '#title': {
    modelAttr: 'model_data',
    format: 'formatTitle'
formatTitle: function(val) {

Does this work out for you?


@delambo I just went with Backbone.Deep-Model, and so when stickit calls model.get() on modelAttr, it returns the nested attribute.


@pheuter Thanks for the update - glad to hear that stickit works well with deep-model.

@delambo delambo closed this

no the reverse does not work on nested model. I am using backbone-nested. And the set command is asymmetric with backbone.

In backbone set is: this.model.set('attr',value). Whereas in backbone-nested or in backbone-deep-model set is : this.model.set({'attr':value}). So how do I overcome this... ?

thanks for the great module anyway...


Not sure I understand, @nilaysaha

In backbone, this.model.set('name', value) is identical in operation to this.model.set({'name': value}) -- the same change events should be raised that stickit checks for, etc.

What sort of problems are you seeing?


Can I see the code for your bindings?

Keep in mind modelAttr has changed to observe since this issue (from a year ago).


Hi @nilaysaha ,

Keep in mind modelAttr has changed to observe since this issue (from a year ago).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.