Have the following in an AngularJS controller:
$scope.initiatives = _.where($scope.initiatives, {i_status_id:'Open'});
It works fine to filter down the list based on a field if the property value is exactly 'Open'.
How do you use wildcard in the filter value so that it picks up 'Open - Pending' if I search for all the ones that contain 'Open'?
You can use _.filter
instead. Something like:
$scope.initiatives = _.filter($scope.initiatives, function(initiative){
return initiative.i_status_id.indexOf('Open')>=0;
});
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With