model
can.Model.model
Deprecated 2.1
Prior to 2.1, .model was used to convert ajax
responses into a data format useful for converting them into a can.Model instance
AND for converting them into that instance. In 2.1, parseModel should
be used to convert the ajax response into a data format useful to model.
Convert raw data into a can.Model instance. If data's id matches a item in the store's id, data is merged with the instance and the
instance is returned.
can.Model.model(data)
Parameters
-
data
{Object}The data to convert to a can.Model instance.
Returns
{can.Model}
An instance of can.Model made with the given data.
Use
.models(data)is used to create or retrieve a can.Model instance with the data provided. If data matches an instance in the store, that instance will be merged with the item's data and returnedsFor example