I am facing a data structure that looks like this:
$scope.people = {
"ID123": {
name_de: "Andre",
name_en: "Anrew",
age: 30,
description: "He is the father of xyz and . . .",
. . .
},
"IDabc": {
name_de: "Markus",
name_en: "Mark",
age: 20,
. . .
},
"IDxyz": {
name_de: "Isaak",
name_en: "Isaac",
age: 23,
. . .
}
. . .
}
and I have an input/ng-repeat:
<input ng-model="query" placeholder="Search . . .">
<ul>
<li ng-repeat="person in people | orderBy:'name_de' | filter:query"> Some output here . . . </li>
</ul>
The question now is how can I effectively order and filter this data?
I previously managed with an Array of persons, but I require the unique "ID's" which makes using objects necessary!?
Additionally, I am searching for a method to filter the object based on multiple properties, such as name_de AND name_en (so it will display ID123 if the search term is Andre or Andrew) WHILE disregarding the "description" property (initially the problem was that the filter checked all properties)