Giter Site home page Giter Site logo

ekarudianto / nouislider-angular-es6 Goto Github PK

View Code? Open in Web Editor NEW

This project forked from yankovsky/nouislider-angular

1.0 3.0 0.0 1.89 MB

Forked NPM package angular wrapper for nouislider

Home Page: http://yankovsky.github.io/nouislider-angular/examples

License: MIT License

JavaScript 100.00%

nouislider-angular-es6's Introduction

This is a forked repository from

Yankovsky nouislider angular directive

This is nouislider angular directive converted into module based so that it could have a es6 'import' syntax support.

nouislider-angular

You could check the demo at Yankovsky website -> http://yankovsky.github.io/nouislider-angular/examples

You can pass any nouislider options options to ya-no-ui-slider directive.

Installation

Install with NPM

npm install nouislider-angular-es6

Basic usage

import from 'nouislider-angular-es6';

angular.module('sampleApp', ['ya.nouislider'])
  .controller('SampleCtrl', function($scope) {
    $scope.options = {
        start: [20, 70],
        range: {min: 0, max: 100}
    }
});
<div ya-no-ui-slider='options'></div>

Options

Global config

You can set global configuration value yaNoUiSliderConfig and all nouislider options will inherit from it:

angular.module('sampleApp', ['ya.nouislider'])
    .value('yaNoUiSliderConfig', {step: 1})

Event handlers

$scope.eventHandlers = {
    update: function(values, handle, unencoded) {},
    slide: function(values, handle, unencoded) {},
    set: function(values, handle, unencoded) {},
    change: function(values, handle, unencoded) {}
}
<div ya-no-ui-slider='options' 
     ya-no-ui-slider-events='eventHandlers'></div>

Disable slider or individual handlers

<div ya-no-ui-slider='options' 
     ya-no-ui-slider-disabled='sliderDisabled'
     ya-no-ui-slider-handle1-disabled='handle1Disabled'
     ya-no-ui-slider-handle2-disabled='handle2Disabled'></div>

Slide event debounce

Use number to specify delay in ms or use special value "Infinity" to disable updating model on slide event.

<div ya-no-ui-slider='options' 
     ya-no-ui-slider-slide-debounce='300'></div>
     
<div ya-no-ui-slider='options' 
     ya-no-ui-slider-slide-debounce='Infinity'></div>

Setting range value example

Use number to specify the range to be reflected on the nouislider view

<div ya-no-ui-slider='options'></div>
<button ng-click="ctrl.options.start = [40, 60]">set [40, 60]</button>
import from 'nouislider-angular-es6';

angular.module('sampleApp', ['ya.nouislider'])
  .controller('SampleCtrl', function($scope) {
    $scope.options = {
        start: [20, 70],
        range: {min: 0, max: 100}
    }
});

Building minified version

To build minified version use npm run build command.

nouislider-angular-es6's People

Contributors

ekarudianto avatar jens1101 avatar kirillsud avatar yankovsky avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.