Created
January 22, 2013 09:45
-
-
Save kimjoar/4593391 to your computer and use it in GitHub Desktop.
Nøstede modeller
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var Message = Backbone.Model.extend({ | |
parse: function(resp) { | |
resp.replies = new Messages(resp.replies); | |
return resp; | |
}, | |
toJSON: function() { | |
var attributes = _.clone(this.attributes); | |
// evt: var attributes = Backbone.Model.prototype.toJSON.call(this) | |
attributes.replies = attributes.replies.toJSON(); | |
return attributes; | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment