1

The Backbone documentation for collections shows example where you set parse when collection is defined.

var Tweets = Backbone.Collection.extend({
  // The Twitter Search API returns tweets under "results".
  parse: function(response) {
    return response.results;
  }
});

But, is there a way to set a function for parse after a Backbone collection has been instantiated?

this.collection.parse = function (response) {
    return response.results;
};

this.collection.fetch();
Abe
  • 6,386
  • 12
  • 46
  • 75

0 Answers0