backbone.jsModel


Syntax

  • var MyModel = Backbone.Model.extend(properties, [classProperties]); // Create a custom model
  • var model = new Backbone.Model([attributes], [options]); // Instanciate a model object

Parameters

ParameterDetails
propertiesInstance properties.
classPropertiesOptional. Properties that exist and are shared with every model instance of this type.
attributesOptional. Initial values of the model's attributes. If this parameter is left out, the model will be initialized with the values specified by the model's defaults property.
optionsOptional. Object which serves to configure the model and is then passed to the initialize function.