![]() |
VOOZH | about |
Backbone.js is a compact library used to organize JavaScript code. Another name for it is an MVC/MV* framework. If MVC isn't familiar to you, it merely denotes a method of user interface design. JavaScript functions make it much simpler to create a program's user interface. Models, views, events, routers, and collections are among the building blocks offered by BackboneJS to help developers create client-side web applications.
Backbone.js Sync is the method that is called Backbone.js to read or save a model to the server. It is utilized to show the model's current status(which CRUD method is being performed).
Syntax:
sync(method, model, options)
Parameters:
Example 1: The code below demonstrates how we can read or create a model and see the method using Sync.
Output:
Example 2: The code below demonstrates how we can read a collection and see the method using Sync.