Paolo B Paolo B - 2 years ago 137
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?

Answer Source

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

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download