rkamun1
rkamun1

Reputation: 338

AngularJS Slider with min-price and max-price columns

I have an object which has two attributes. One's named min-acceptable-price, and the other named max-acceptable price. In my index page, I'm using the slider to filter out using these two values, such that the $scope.maxPrice uses the objects' max-acceptable-price to filter and the $scope.minPrice uses the min-acceptable-price to filter.

This is to say that if we select a min-acceptable-price of $10 and a max-acceptable-price of $20, then the search function should check all min-acceptable-prices to see that they are greater than $10 and all max-acceptable-prices to see that they are less than $20.

Is it able to do this using AngularJS slider?(http://prajwalkman.github.io/angular-slider/)

Thanks for your help!

Upvotes: 4

Views: 11382

Answers (2)

sluiper
sluiper

Reputation: 91

I have the same requirement, so I modified angular-slider by adding custom-ceiling and custom-floor.

By specifying these 2 extra attributes, the slider will start and end based on bindable values and not on the specified floor and ceiling.

Plunker here: http://plnkr.co/edit/hNg2gOTHa7ig2hPsrmZ8?p=preview

Upvotes: 4

thebenedict
thebenedict

Reputation: 2589

:)

How about using the slider to update an upper and lower price bound on the scope, and then filtering on those bounds: http://plnkr.co/edit/uF31rMbNLzF382GUZYqr?p=preview

Upvotes: 4

Related Questions