backbone

再帰的なtoJSON()

http://www.shesek.info/web-development/recursive-backbone-models-tojson Backbone.Model.prototype.toJSON = function() { if (this._isSerializing) { return this.id || this.cid; } this._isSerializing = true; var json = _.clone(this.attributes)…