Fluid Range Slider with AngularJS

demo | download code Range Slider


This range slider works on mobile browsers as well as web browsers and utilizes a simple animation to show content being added/removed. The CSS is fluid so it should work and look fine between browser sizes. I built this range slider for an older version of and decided to give out the code as someone might find it useful.


Create a custom range slider that lets you filter an array. Drag the scrubber left or right to change the time input. Your food items will appear or disappear if they belong or not.


Include AngularJS, NgAnimate and NgTouch

<script src=""></script>
<script src=""></script>
<script src=""></script>

Add the Ranger directive and your ng-repeat list for your items. As you slide the range items will appear or disappear. You can also click on the "bits" to jump to a range. You can customize your ranges (if you add more/less then 5 you have to edit CSS and Javascript) as well as what number you start at.

<ranger options="rangeOpts" start="rangeNum"></ranger>
<div class="item-list" ng-repeat="item in items | filter:prepTimeFilter">
	{{}} ({{item.time}})		


Copy and paste this to your controller



$scope.prepTimeFilter = function (location) {
return location.time <= $scope.rangeNum;


The Ranger directive will work with Mouse and Touch events. It will also scale with your browser window.

full code

View the demo or download the source code above to view all of the code


To customize you'll need to edit css and javascript. This is more of a friendly example of some cool things you can do with AngularJs. If there is enough interest I can build a more customizable directive.

the end

Hopefully this was a helpful AngularJS tutorial, send feedback to my twitter or on reddit.
Follow me for more @dombruno