Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
146 lines (107 sloc) 2.6 KB

{{ properties: { category: "api" } }}

Extends bindable.Collection


npm install mojo-models --save-exact

Collection(properties[, application])

  • properties - properties to set on the collection

{{#example}} {{#block:"index-js"}}

{{/}} {{/}}


the raw source for the collection. Should be an array.

{{#example}} {{#block:"index-js"}}

{{/}} {{/}}

model createModel(options)

Creates a model. This method is usually defined when extending the base collection. It's also called when deserializing each item in data. See example above.


The id property for each model. This id "_id" by default.

model create(properties)

creates a new model, and adds to the collection immediately. See example above.

{{#example}} {{#block:"index-js"}}

{{/}} {{/}}


Deserializes data, and sets the returned value as the source of the array.

{{#example}} {{#block:"index-js"}}

{{/}} {{/}}


serializes collection into an array. alias to toJSON

Extended API

See extended api on models.Base