I am trying to apply a price filter my ng-repeat
. Currently the code filters the price only for an exact match; I need it filter to include every location that has that price.
My html looks like the following
<select id="maxPrice" ng-model="searchPrice" class="filterSelect">
<option selected="">Max Price</option>
<option>Free</option>
<option>$1,000</option>
<option>$2,000</option>
<option>$3,000</option>
<option>$5,000</option>
<option>$8,000</option>
<option>$13,000</option>
<option>$21,000</option>
<option>$34,000 </option>
</select>
<div ng-repeat="school in diffSchools | filter:{Cost:searchPrice}" class="item">
<p class="title">{{school.campName}}</p>
</div>
Currently this filters schools to return only exact matches on the number. The object it is searching looks like the following:
{
"campName": "Camp1",
"Cost": ["$2,500-$12,000"],
}
How can I filter to include everything below and including the selected option's price?
I have examined the following couple of stack overflow questions, which discuss filtering using a fixed number (in one instance 0) or are quite different from my problem, especially for a non-expert angular user.