Models provide an abstract API for connecting to your Services.
By implementing static:
You can find more details on how to implement each method. Typically, you can just use templated service urls. But if you need to implement these methods yourself, the following is a useful quick reference:
attrs - an Object of attribute / value pairssuccess([attrs]) - Create calls success when the request has completed
successfully. Success can be called back with an object that represents
additional properties that will be set on the instance. For example, the server might
send back an updatedAt date.error - Create should callback error if an error happens during the requestdeferred - A deferred that gets resolved to any additional attrs
that might need to be set on the model instance.params - an Object that filters the items returnedsuccess(items) - success should be called with an Array of Model instances.error - called if an error happens during the requestdeferred - A deferred that gets resolved to the list of itemsparams - an Object that filters the item returnedsuccess(item) - success should be called with a model instance.error - called if an error happens during the requestdeferred - A deferred that gets resolved to a model instanceid - the id of the instance you are updatingattrs - an Object of attribute / value pairssuccess([attrs]) - Call success when the request has completed
successfully. Success can be called back with an object that represents
additional properties that will be set on the instance. For example, the server might
send back an updatedAt date.error - Callback error if an error happens during the requestdeferred - A deferred that gets resolved to any additional attrs
that might need to be set on the model instance.id - the id of the instance you are destroyingsuccess([attrs]) - Calls success when the request has completed
successfully. Success can be called back with an object that represents
additional properties that will be set on the instance. error - Create should callback error if an error happens during the requestdeferred - A deferred that gets resolved to any additional attrs
that might need to be set on the model instance.