Paolo B Paolo B - 4 months ago 14x
AngularJS Question

ng-true-value='0' picking up wrong values

For demo see jsfiddle here and click on the

Out of Stock

It should only show stock with quantity of 0, but it is also picking up quantity of 30. I think this is becasue it is matching against string values.

I assume issue is with:


What is best way to fix this? Please can you provide code example?


Make strict value dynamic:

<div ng-repeat="item in inventory | filter: searchInventory:!!searchInventory.qty | orderBy:sortOrder">

Note: this might get messy if you have multiple similar criterias