I am using a filter in a ng-repeat to separate a list of Jsons in two sub-lists: One with Present-past items and other with future items. The json has a key called "dateFrom" which i compare with the actual date to determine in which list this item will appear.
But, despite the filter function only uses the "dateFrom" key to determine this, if i modify some other keys as well, the filter changes.
I made a quick jsFiddle to show the problem:
https://jsfiddle.net/1j2p2hbg/1/
The filtering function is:
$scope.isPast = function(item)
{
var now = new Date();
return (item.dateFrom <= now);
}
We have there 4 elements... 3 of them have the actual date and other has a future date. The "isPast" function ONLY checks the "dateFrom" attribute, but if i change the attributes "keyBoolOne" and "keyBoolTwo", it will affect the filter as well.
Anyone could tell me why?
Thanks in advance!