How do I trigger the success callback on a model.save()?

前端 未结 8 1002
粉色の甜心
粉色の甜心 2020-11-28 23:06
this.model.save({
  success: function(model, response){
    console.log(\'success\');
  },
  error: function(){
    console.log(\'error\');
  }
})

8条回答
  •  迷失自我
    2020-11-28 23:50

    The first argument of save is the attributes to save on the model:

    this.model.save( {att1 : "value"}, {success :handler1, error: handler2});
    

提交回复
热议问题