Skip to content Skip to sidebar Skip to footer

Model Save Backbone

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( { success:

Solution 1:

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

savemodel.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) { ... }
});

Post a Comment for "Model Save Backbone"