#106 Filter by Multiple Values
There is no way to pass multiple values to
filterBy if you want to perform an or. For example, in Hyperlogs, we wanted to display projects that are both
done and if we try:
return this.get('myProjects').filterBy('status', 'done').filterBy('status', 'active');
we get an empty array because we are filtering by status done AND active which is always going to be zero.
The best way to do this is to use filter instead:
this.get('myProjects').filter(project => project.get('status') === 'done' || project.get('status') === 'active');
Originally published at Ember Daily Tips.