Ranjith M
Ranjith M

Reputation: 529

Range slider filter in ng-repeat (Angular Ranger)

I'm using Angular Ranger v~0.1.3 in my project. I want to filter my ng-repeat according to the sliding event. I tried some methods but nothing seems to work. I'am providing my code below. I want to filter the ng-repeat on price

html

<angular-ranger min="30000" max="200000" step="1" min-value="value.min" max-value="value.max"></angular-ranger>
<div ng-repeat="data in assets|filter:rangeFilter">
  Property: {{data.name}}
  price: {{data.price}}
</div>

controller

$scope.assets= data.assets;
$scope.value = {
    min: 30000,
    max: 200000
};

Upvotes: 1

Views: 611

Answers (1)

Novarac23
Novarac23

Reputation: 155

I am not an expert in angular-ranger library but I took a quick look at the api and it looks like there is no rangeFilter filter exposed in it. It only works with <angular-ranger> directive and values are directly bound to yours $scope.value.

What might be worth trying your is to put <angular-ranger> directive inside of ng-repeat and putting min, max on the $scope.assets!

Hope that helps! :)

Upvotes: 0

Related Questions