Paolo B Paolo B - 8 months ago 43
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