
Security News
Browserslist-rs Gets Major Refactor, Cutting Binary Size by Over 1MB
Browserslist-rs now uses static data to reduce binary size by over 1MB, improving memory use and performance for Rust-based frontend tools.
ng-range-slider
Advanced tools
Multi-handle range slider utilising the native HTML5 input range elements.
bower install ng-range-slider
ngRangeSlider
is an experimental module for two reasons: it uses the input range
element – and secondly, ngRangeSlider
goes one step further to stack each input
using special CSS selectors.
I created the module due to an observation on the limitation of input range
elements – they are restricted to only one handle. Essentially ngRangeSlider
is a HTML5 implementation of jQuery's range slider.
With ngRangeSlider
the CSS is just as important as the JavaScript. Without the CSS the input range
elements will still have a direct relationship, but they will not be stacked.
For the styles please refer to the Default.css
document in the example, as this provides a fairly comprehensive list of the styles to be applied to the input range
elements.
ngRangeSlider
is a typical Angular directive which requires an ng-model
attribute which it will write the range to in the form of { from: 0, to: 10 }
.
<section data-range-slider ng-model="range"></section>
You're also able to apply the min
, max
, and step
attributes – and these may also be changed after the directive has been initialised.
<section data-range-slider ng-model="range" min="minValue" max="maxValue"></section>
Each and every time the value of the range has been updated the ng-model
will be updated. In our case using the example above it will write to $scope.range
.
Current range is {{range.from}} to {{range.to}}!
ngRangeSlider
also supports the concept of event throttling. For example, when you're dragging the slider, the ng-model
is updated with every change. However when you're implementing a feature such as fast filtering, you may wish to throttle the updating of ng-model
to prevent excessive AJAX requests and/or WebSocket events. By specifying the throttle
attribute in milliseconds you can achieve this:
<section data-range-slider ng-model="range" throttle="1500"></section>
In the above example, the ng-model
will only be updated every 1,500 milliseconds. You need to have either Underscore.js or Lo-Dash installed.
FAQs
Multi-handle range slider utilising the native HTML5 input range elements.
The npm package ng-range-slider receives a total of 31 weekly downloads. As such, ng-range-slider popularity was classified as not popular.
We found that ng-range-slider demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Browserslist-rs now uses static data to reduce binary size by over 1MB, improving memory use and performance for Rust-based frontend tools.
Research
Security News
Eight new malicious Firefox extensions impersonate games, steal OAuth tokens, hijack sessions, and exploit browser permissions to spy on users.
Security News
The official Go SDK for the Model Context Protocol is in development, with a stable, production-ready release expected by August 2025.