Closed satyasuman closed 11 years ago
That really depends on your model objects and if they support observing nested keypaths or not. If they do, then just make sure your adapter.subscribe
implementation is subscribing to them in the same way you would subscribe to nested keypaths. Depending on how your models work, you may also need to change your adapter.read
and adapter.publish
implementations.
If you mean just accessing (not binding to) a deeply nested value in an object using the adapter bypass, then no, that's not supported at the moment, you would have to pass those nested objects as contexts when doing rivets.bind
.
For example if you have this structure:
user =
fname: "Bob"
lname: "Vance"
profile:
email: "bob@vancerefrigeration.com"
company: "Vance Refrigeration"
And you wanted to bind to values that are at the user
root, and values that are on user.profile
:
rivets.bind el, user: user, user_profile: user.profile
<span data-text="user:fname"></span>
<span data-text="user_profile:email"></span>
Hi, does this work when we have a deeply nested JSON object?