Skip to content
This repository has been archived by the owner on Feb 10, 2019. It is now read-only.

usmakestwo/pretty-slider

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Pretty Slider

Slider implementation for AngularJS, without jQuery dependencies. Requires AngularJS v1.1.4 or higher.

License: MIT

Example:

<ul>
    <li ng-repeat="item in items">
        <p>Name: {{item.name}}</p>
        <p>Cost: {{item.cost}}</p>
        <div pretty-slider floor="100" ceiling="1000" step="50" precision="2" ng-model="item.cost"></div>
    </li>
</ul>

And your HTML:

<div pretty-slider floor="100" ceiling="1000" step="50" precision="2" ng-model="item.cost"></div>

Usage:

Make sure to load AngularJS first, and then pretty-slider.js. Also include the related pretty-slider.css.

To build use gulp watch.

The module name is named prettySlider. To enable it, you must simply list it as a dependency in your app. Example:

var app = angular.module('app', ['prettySlider', 'ngResource', ...]);

You can then use it in your templates like so:

<html ng-app='app'>
    ...
    <body>
        ...
        <div pretty-slider ...></div>
    </body>
</html>

Parameters

Param Type Required Default Details
ng-model expression Yes none Assignable angular expression to which to data-bind the value.
floor float Yes none The lowest value possible
ceiling float Yes none The highest value possible
step float No inf The width between each tick.
precision integer No 0 The numerical precision to which to round the value.
--

Demo

You can find a demo of the slider here.

Known issues:

  1. When having a value great than zero as a floor the fill does not account for it.

License: MIT

About

A jquery-less slider implementation for AngularJS

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published