I have a data structure structured in the following way:
$scope.data = [
{
title: "Title1",
countries: ['USA', 'Canada', 'Russia']
},
{
title: "Title2",
countries: ['France', 'Germany']
}
];
Each item contains an array of country names.
The data is displayed as follows:
<tr ng-repeat="dataItem in data">
I would like to allow users to filter this list by entering a list of countries in an input field:
How can I achieve this?
Currently, I have implemented something similar to this:
<input ng-model="searchFilter.countries">
...
<tr ng-repeat="dataItem in data | filter: searchFilter: true">
However, this only works for one country and not for arrays of countries listed in the input separated by commas.