I\'ve started learning Knockout and I\'m having some trouble filtering an observable array on a button click and displaying the results.
This is my model:
You might want to have a look at Knockout Projections plugin from the author of original knockout. It has performance advantages in scenarios with large collections. See blogpost for more details.
self.filterProducts = self.products.filter(function(prod) {
return !self.currentFilter() || prod.genre == self.currentFilter();
});