The Backbone.JS Sync() model communicates with the server and also represents state of a model.
Syntax:
Model.Sync (method, model, options)
Parameters:
method: This parameter is used to specify the create, read, update and delete operations, also called as the CRUD operations.
model: This parameter is used to save the data on the model.
options: This parameter is used to fire SUCCESS or ERROR messages.
Example:
Example
Output:
create: Hello! Welcome.