January 2016
Intermediate to advanced
278 pages
4h 53m
English
This is responsible to handle connections between a RESTful server and the Backbone application is the Backbone.sync module. It transforms the fetch() and save() operations into HTTP requests:
fetch() is mapped as a read operation. This will make GET to the the urlRoot attribute with the model ID for a model or the url attribute for a collection.save() is mapped as a create or update operation; it depends on the isNew() method:create if the model does not have an ID (isNew() method return true). A POST request is executed.update if the model already has an ID (isNew() method returns false). A PUT request is executed.destroy() is mapped as a delete operation. This will make DELETE to the ...Read now
Unlock full access