My backbone.js model has a json object in defaults like this:
test: {
testArr: [{
obj1: value1,
obj2: value2
}]
}
How can I update just a part of the model for eg: test.testArr[0].obj1 using this.model.set()?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You’ll need to extract the array from the properties, update it, and inject it back in. Assuming your model is called
model, that would look like: