Skip to content
This repository has been archived by the owner on Jan 2, 2019. It is now read-only.
teleological edited this page Aug 23, 2011 · 1 revision

A Slickback.Scope represents a set of parameters that can be used to fetch a collection. Supported parameters depend on the data source. A data source for a Backbone.Collection is usually accessed via an ajax GET request, in which case the parameters are supplied in the query string. Parameters may specify pagination options, sort order, or filtering criteria.

A Scope instance supports the fetch method, which accepts an options object and delegates the fetching to its attached collection. Scope parameters are merged into the data member of the options object, if any, with data members taking precedence over scoped parameters.

Scope also supports extend, which merges a supplied object into the scoped parameters, and scoped, which returns a cloned scope object.

The Slickback.ScopedModelMixin (see Mixins) provides methods for binding a collection to a default scope.

Clone this wiki locally