backbone.js change url parameter of a Model and fetch does not update data fetched

后端 未结 4 503
再見小時候
再見小時候 2021-02-04 10:28

I have the following Model:

window.MyModel = Backbone.Model.extend({
     initialize: function(props){
          this.url = props.url;
     } 

     parse: funct         


        
4条回答
  •  后悔当初
    2021-02-04 10:35

    You can set url as option in fetch function, like this:

    var mod = new MyModel();
    mod.fetch({
       url: '/some/other/url',
       data: {}
    });
    

提交回复
热议问题