how to override Backbone's parse function?

后端 未结 2 510
既然无缘
既然无缘 2020-12-22 11:53

I try to use backbone in my project. But I have met problem when try to overide parse method of Backbone. The server has send back more data than I want.For example: What

2条回答
  •  礼貌的吻别
    2020-12-22 12:22

    From Backbone Parse docs

    Collection = Backbone.Collection.extend({
        model: YourModel,
        parse: function(response){
            return response.items;
        }
    });
    

提交回复
热议问题