I'm facing an issue with my filters. I have a JSON dataset that I need to display on my website, but I only want to show 4 elements that meet a certain criteria. Here's the code snippet:
<div ng-repeat="place in places | limitTo: 4 | filter: {cheap: 'true'}" class="col-lg-3">
My problem is that if the first element in the JSON data has "cheap = false," only 3 items are displayed instead of 4. It seems like the ng-repeat starts counting from the beginning of the dataset and stops at the 4th element, regardless of whether it meets the filter condition.
Is there a way to modify the filter to skip over any elements that don't meet the criteria, so that I can display the next 4 true elements?
I hope this explanation makes sense. Thank you for your assistance!