Skip to content
This repository was archived by the owner on Jul 7, 2026. It is now read-only.
This repository was archived by the owner on Jul 7, 2026. It is now read-only.

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

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?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions