Model save backbone

前端 未结 1 514
抹茶落季
抹茶落季 2021-01-21 12:35

I\'m saving a model on a online db Parse.com. The save function works perfectly but the callback function inside save are not called.

this.utente.save( {
                


        
相关标签:
1条回答
  • 2021-01-21 13:29

    Backbone.Model#save takes options in the second argument:

    save model.save([attributes], [options])

    Save a model to your database (or alternative persistence layer), by delegating to Backbone.sync.

    If you want to call save without any particular attributes and you want to supply options, say:

    model.save(null, { ... })
    

    You probably want to say:

    this.utente.save(null, {
        success: function (persona) { ... },
        error: function (data) { ... }
    });
    
    0 讨论(0)
提交回复
热议问题