How do I fetch a single model in Backbone?

前端 未结 7 1125
误落风尘
误落风尘 2020-11-30 18:36

I have a Clock model in Backbone:

var Clock = Backbone.Model.extend({});

I\'m trying to get an instance of that that has the l

7条回答
  •  天涯浪人
    2020-11-30 19:18

    ...and do this if you don't want the trailing slash on the model urlRoot:

        url : function() {                        
            return this.urlRoot + this.id;
        },
    

提交回复
热议问题