Skip to content

changedAttributes return entire deep object instead of only the changed field #74

Open
@ericchaves

Description

@ericchaves

Hi there,

After updating a sub-set of nested properties, calling model.changedAttributes will return the entire object instead of only the changed ones.

var book = new Backbone.NestedModel.model({
    title: 'abook',
    author: {
        first_name: 'Jane',
        last_name: 'Doe'
    },
    category: 'Mistery'
});
book.save();
...
book.set({
    title: 'TheBook',
    author: {
        first_name: 'Jhon'
    }
});
console.log(book.changedAttributes());
/* printed result is
{ 
    title: 'TheBook',
    author: {
        first_name: 'Jhon',
        last_name: 'Doe'
    }
}
*/

Would it be possible to just return the changedAttributes?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions