Is there a way to have a different Backbone.sync method invoked for a subset of models in an application?
I have been experimenting with binding models to socket.io, but I don't want all of them to work that way. I would like some of them to stick with REST.
Am I asking the wrong question and overriding sync is the wrong approach?
Backbone. Backbone has been around for a long time, but it's still under steady and regular development. It's a good choice if you want a flexible JavaScript framework with a simple model for representing data and getting it into views.
Model contains dynamic data and its logic. It performs various types of action on the data like validation, conversion, computed properties, access control etc. 1. It extends Backbone.
Backbone. js is a model view controller (MVC) Web application framework that provides structure to JavaScript-heavy applications. This is done by supplying models with custom events and key-value binding, views using declarative event handling and collections with a rich application programming interface (API).
var Model = Backbone.Model.extend({
sync: function (method, model, options) {}
})
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With