TIMEX
TIMEX

Reputation: 271774

How do I add a batch of models to a collection that already has items?

I'm building a news feed. On initialization, the app calls Collection.fetch() and receives 20 stories.

Then, when a user clicks "load more", I want to fetch 20 more stories, and add it to the collection. (I will hit a URL to do this.)

However, .fetch resets the collection. How can I hit a URL and download more stories without resetting the collection?

Upvotes: 0

Views: 137

Answers (1)

Eric Turner
Eric Turner

Reputation: 1824

Pass {add: true} as an option to fetch.

Upvotes: 1

Related Questions