How can I filter the content in my array controller with an array?
I know I can do this for multiple filters:
App.ItemsController = Ember.ArrayController.extend({
filter: function() {
var content = this.get("content");
return content.filter(function(data) {
return (data.get("foo1")) &&
(data.get("foo2")) &&
(data.get("foo3"));
});
}
});
or with just one:
return content.filterBy("foo1");
But if I wanted to filter with an array how would I do that?
I imagine something like this:
var array = ["foo1", "foo2", "foo3"];
return content.filterBy(array);
But this obviously doesn't work.
I ask because I use up to 20 filters and it would be helpful if I could do it with an array.
If there is an "ember way" to do this that would help me a lot.
Aucun commentaire:
Enregistrer un commentaire