Alloy.Collections

Class to access or create collections.

Collections can either be created in markup or programmatically in the controller.

To create collections in markup use a <Collection/> element. For more information see Collection Element in the Alloy developer guide.

In the controller code:

Previously created collections through markup or using the instance() method are directly accessed as properties of the Alloy.Collections namespace, using either the name of the model JavaScript file for singletons or the ID name for local instances.

Defined By

Methods

Alloy.Collections
( name ) : Backbone.Collection
Creates a singleton instance of a Collection based on the given model, or returns an existing instance if one has alr...

Creates a singleton instance of a Collection based on the given model, or returns an existing instance if one has already been created.

Parameters

  • name : String

    the name of the base model for the collection

Returns

  • Backbone.Collection

    An Alloy Collection object singleton