Is there a way to utilize a select menu for filtering items based on greater than/less than conditions?
HTML:
<select name="likes-filter" id="likes-filter" class="form-control" data-ng-model="filterValue">
<option value="0">0</option>
<option value="10">> 10</option>
<option value="20">> 20</option>
<option value="50">> 50</option>
<option value="100">> 100</option>
<option value="500">> 500</option>
<option value="1000">> 1000</option>
</select>
<div class="image-container" data-ng-repeat="image in images | filter: filterValue | orderBy: dateSubmitted">
<div class="like-wrapper">
<i class="glyphicon glyphicon-heart"></i>
<p>{{image.likes}}</p>
</div>
<p class="date">{{image.dateSubmitted | date: 'medium'}}</p>
<img data-ng-src="{{image.path}}" alt="Image">
<span class="btn" data-ng-click="confirmImageDelete(image)">×</span>
</div>
JS:
$scope.images = [
{
dateSubmitted: new Date(),
path: "/images/profile-placeholder-250x250.gif",
likes: 5
},
{
dateSubmitted: new Date(),
path: "/images/profile-placeholder-250x250.gif",
likes: 9
}];
If I want the select menu to filter the images repeat based on a greater than like count, how can this be achieved?
For example,
<option value="likes > 10">> 10</option>
should only display images with a like count greater than 10.
Any assistance or guidance would be greatly appreciated. Thank you!