I encountered the error I tried to use the reset method on one of my view's collection.
Here is its implementation
The collection:
window.Cards = Backbone.Collection.extend({
model: Card,
url: "/cards"
});
The router file:
var cardsList = new Cards();
cardsList.fetch({success: function(){
filteredCards = cardsList.where({Class: "ABC"}).concat(cardsList.where({Class: "ZYX"}));
this.deckbuild = new Deckbuilder({collection:filteredCards});
}});
In my Deckbuilder view file I created another view within it using the same collection:
var cardselectView = new CardSelect({collection: this.collection});
Then in the CardSelect view file I wrote:
blahblah = new Collection();
this.collection.set(blahblah);
Then the error appeared. Is there anything wrong this my implementation? Did I violate some abstraction? I can no longer use any of Backbone's collection method on my collection object anymore.
where,findWhereand bunch of methods return array not an instance ofBackbone.CollectionPlease refer back toBackbonedoc… backbonejs.org