I'm using angular's $filter("filter") to filter an array o objects. Since I have a complex filtering I decided to define a comparator. Nonetheless, inside my comparator only the attributes that appear on the filtering expression are available
var array = [
{"id": 1, "placeId":253, "name":"John"},
{"id": 2, "placeId":253, "name":"Jane"},
{"id": 3, "placeId":32, "name":"Mike"},
{"id": 4, "placeId":89, "name":"Ana"}
];
var awesomeFiltering = function(){
return $filter("filter")(array, {"placeId":253}, function(actual expected){
// "actual" brings only the value for placeId attribute!
// How do I access attribute "name", for example?
});
};
How can I acces the other attributes from the object inside the comparator?