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 active
and done
and if we try:
1 |
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:
1 |
this.get('myProjects').filter(project => project.get('status') === 'done' || project.get('status') === 'active'); |
Also published on Medium.