Is it possible to filter multiple values ​​in emberjs?

Is it possible to filter multiple values ​​in emberjs?

I am trying to filter items in a table with various filtering variables, and I am having problems with more than one of these variables.

Can anyone help? I do not like emberjs and want to study. Thanks in advance.

+6
source share
1 answer

You cannot pass multiple properties to the same filterBy , but you can filterBy in the same array 2 times, i.e. filterBy chaining calls, if that makes sense.

See the following answer I recently gave ( here ) for a working demonstration of what I'm talking about

So, in short, if you have an arr array and you want to filter it using the country and name properties, for example:

 arr.filterBy('country', countryName).filterBy('name', 'Josh') 

You can also just use the filter method (unlike filterBy ) and filter everything as you would like.

+8
source

Source: https://habr.com/ru/post/981469/


All Articles