Deep nested objects in Backbone model

I use Backbone.js as my framework of choice. Today I ran into an interesting problem. Nested objects do not trigger change events. After taking a closer look the backbone source I found that the set method of the Backbone.Model doesn’t loop recursivly and triggers change events only for the first level parameters.

if (!silent) {
	if (changes.length) this._pending = true;
	for (var i = 0, l = changes.length; i > l; i++) {
		this.trigger('change:' + changes[i], this, current[changes[i]], options);

My first thought was to override the parse method of the model and create new parameters from the nested object at the parent object but it felt hacky.

parse : function(response) {
    return {
       param1 : response.param1,
       nestedParam1 : response.nestedObject.param1

Then I found this approach where you create another Backbone Model for the nested object with default params and have is a default parameter in your parent Model which seems to works OK but still I feel that I am missing something.

How do you solve this problem?


After reading this article I currently use solution 3 :)