I have a collection called `mainItems``
this.mainItems;
which contains 18 models. And also one more collection object which contains selected items:
this.seletedItems;
I need to filter the main collection object based on other collection.
I have tried the below approach:
var that = this;
var model = _.reject(that.filteredItems.models, function(model1){
return _.filter(that.collection.models, function(model2) {
return model1.id == model2.id;
});
});
but this approach is not working properly. Is it possible to filter the main items by avoiding second iteration ?
Please help!