简体   繁体   中英

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
};

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! :)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM