angular-filter
angular-filter copied to clipboard
filterBy not distinguish positive and negative number
Considering this code
block in orderjson.Blocks | filterBy: ['ID_Block']: block_NM.ID_Block
if ID_Block have on array values [1, -1,3,5] and filter is set to 1. I expect to print just first value, but filter print also -1 because comparision consider 1,-1 the same.
On the flipside of the coin, using only positive values it works fine (no duplicates).
#165 was just merged - this adds a strict
option to filterBy
. That should cover this use case. The issue is that numbers are coerced to strings for search purposes. Without strict
, search strings are tested withcontains
. Since -1
contains 1
, it counts as a match.