DS#createCollection
DS#createCollection(resourceName[, array][, params][, options])
Create a new collection of the specified Resource. Collection are somewhat like Backbone.Collection
. They have a .fetch([options])
method which will call DS#findAll
with the params you provided, and splice the result into the collection.
You can create Collections that use cacheResponse: false
, so their contents are never injected into the store, otherwise Collections end up being a subset of the data in the store.
You can call
DS#createCollection
multiple ways
DS#createCollection(resourceName[, array][, params][, options])
Resource#createCollection([array][, params][, options])
- Where Resource was created byDS#defineResource
Argument | Type | Description |
---|---|---|
resourceName |
| The name of the resource to use. Unnecessary if calling |
array (optional) |
| Default |
params (optional) |
| Query parameters. Default: |
options (optional) |
| Settings are inherited from Resource and Global defaults. Will be passed through to |
Demo
Need help!
Want more examples or have a question? Ask on the Slack channel or post on the mailing list then we'll get your question answered and probably update this wiki.
Updated less than a minute ago