new Syncer(options)
Parameters:
| Name | Type | Description | |||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options |
Object |
Properties
|
Members
(protected) _methodMap
Map from CRUD operations to HTTP verbs for default syncer implementation.
Methods
(protected) _authorize(params) → {Object}
Augments request params with authorization header. Feel free to override with your logic.
Parameters:
| Name | Type | Description |
|---|---|---|
params |
Object |
Returns:
augmented request params
- Type
- Object
(protected) _urlError()
ajax() → {jQuery.Deferred}
Performs ajax request
Returns:
- Type
- jQuery.Deferred
sync(method, model, optionsopt) → {jQuery.Deferred}
Pretty much the same as Backbone.sync, only allows to extend requests with authorization headers
Parameters:
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
method |
String | |||
model |
Backbone.Model | Backbone.Collection | |||
options |
Object |
<optional> |
{} | Allows to override any request param |
Returns:
- Type
- jQuery.Deferred