Giter VIP home page Giter VIP logo

angular-bootstrap-slider's Introduction

Hey there!

About Me

  • ๐Ÿ‘‹ I'm Kyle, and I'm an open source enthusiast. I love making cool stuff but even more so when I can share it with the world.
  • ๐Ÿ”ญ In the past, I've worked on some interesting, big game projects IdleLands and Land of the Rair.
  • ๐ŸŽฒ I love playing board games and like to make software to make board games more fun!
  • ๐ŸŽ Want to support my creations? Check me out on GitHub Sponsors and Patreon!

Professional Activity

  • ๐ŸŒฑ Professionally, I do Angular and/or Ionic contract work. I'm always looking to make more cool apps.
  • ๐Ÿ–ผ๏ธ I keep an updated portfolio of my side projects, check it out!
  • ๐Ÿ“ฐ Looking for a resume instead?
  • ๐Ÿ’ฌ Want to talk with me? Toss me an email at kyle at seiyria dot com.

Me On Github

I โค๏ธ open source!

Seiyria's GitHub Stats

angular-bootstrap-slider's People

Contributors

alankyshum avatar aluminumangel avatar bitsmuggler avatar david-hollifield avatar decherneyge avatar guitarfish avatar hmillet avatar hristozov avatar j-a-m-l avatar j-r-t avatar julianwielga avatar jwlogemann avatar kesse avatar knstntn avatar kou avatar makzee avatar mareoraft avatar matiasdelgado avatar mheppner avatar miromannino avatar owumaro avatar pfrankov avatar redox avatar samgraber avatar santam85 avatar seiyria avatar snurby7 avatar srasch avatar super-ienien avatar thisispaul avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

angular-bootstrap-slider's Issues

Requirements for installation are not clear

Just include slider.js and use the package ui.bootstrap-slider.

I actually had to include seiyria-bootstrap-slider/dist/bootstrap-slider.min.js and seiyria-bootstrap-slider/dist/css/bootstrap-slider.min.css too.

Also, looking at the code, I'm not sure it works without jQuery, like the original plugin is supposed to. It would really be a plus, since most angular modules for UI still require it...

When using range option, changes to ng-model outside the slider do not function

When I use a simple slider I can externally (another input or in controller) change the ng-model value of the slider, and the slider slides accordingly. This does not work for a range slider.

See example:

Range Slider (binds only one way)
<slider
    ng-model="exampleModel"
    value="exampleModel"
    min="0"
    step="1"
    max="10"
    range="true"
></slider>

Min:
<input
    type="number"
    min="0"
    max="10"
    step="1"
    ng-model="exampleModel[0]"
/>
Max:
<input
    type="number"
    min="0"
    max="10"
    step="1"
    ng-model="exampleModel[1]"
/>

Min Slider(works)
<slider
    ng-model="exampleModel[0]"
    value="exampleModel[0]"
    min="0"
    step="1"
    max="10"
></slider>

There should be two way binding on the model.

Can't use slider as attribute

Trying to use slider as attribute:

<span slider ng-model="sliders.secondSliderValue" min="0"></span>

The result is code wrapped in <div>, not <span>:

<div slider="" ng-model="sliders.secondSliderValue" min="0" class="ng-isolate-scope ng-valid">
    <div class="slider slider-horizontal" id="" style="width: 100%;"> ... </div>
    <input class="slider-input" type="text" style="width: 100%; display: none;" data-value="0" value="0"> 
</div>

How to reset price filter

Hello guys

In jquery i used this method priceArray = mySlider.refresh();
and it working fine but but in angular i have ng-model="multipleDemo.sliderValue" so i try to empty this model with ng-click event $scope.multipleDemo.sliderValue = {}; But it throw some error...
error

setting the tooltip while using slider as an element

I am using the following code when creating this slider as an element.

< slider id="uniqueID" ng-model="value" value="yearMin" min="1" step="1" max="10" ng-change="myfunction(value)" >
< /slider >

When I include tooltip="hide" as one of the html attributes, I am getting the following error: https://docs.angularjs.org/error/$compile/multidir?p0=slider&p1=tooltip&p2=new%2Fisolated%20scope&p3=%3Cdiv%20tooltip%3D%22hide%22%20id%3D%22yearSlider%7B%7Bdhmsmdeploymentmaptools.containerClass%7D%7D%22%20ng-model%3D%22yearValue%22%20value%3D%22yearMin%22%20min%3D%22yearMin%22%20step%3D%22hop%22%20max%3D%22yearMax%22%20ng-change%3D%22broadcastControl(%27updateYear%27,%20yearValue)%22%3E

Is there a different way I should be setting the tooltip hide/show value?

use of the formatter

Hi,

Thanks for working on this directive.

Could you tell me if the formatter is working and if so how? I want to adjust the texts in the tooltips and judging from the documentation of the bootstrap slider project the formatter is the thing i should be using.

Please tell me how to apply the formatter in the context of this angular implementation.

Best,

Dirk

slide events not passing values?

I recently upgraded to v 0.1.17 and noticed that the new value from the slider is never passed in?

on-start-slide="onSlideHandler(value, $event)"

When I debug it hits the handler but value is the same everytime and $event is undefined?

Detect change in range slider

When using a range slider, I want to get which, either start or end has changed. I'm trying to bind events or use a $watch but it's getting buggy to know which is the one being changed:

Using a $watch this is what I try:

$scope.$watch('rangeSlider.value', function (newValue,oldValue) {
    var changed = newValue[0] === oldValue[0] ? newValue[1] : newValue[0];
            ....
            ....
});

But as I say, it's not reliable. Would you suggest any alternative?

Feature request : set formater

It would be nice to be able to set the 'formater' option of the bootstrap-slider.

I tryed to do it myself but couldn't find a proper way to set a function in the attributes of the <slider> element.

Coloring the low and high track segments.

In the slider for bootstrap examples (http://seiyria.github.io/bootstrap-slider/), they color the low/high tracks and selections with the following CSS. However, this is the markup that is rendered when using this directive, where there is no slider-track-low and slider-track-high?

<div class="slider-track">
  <div class="slider-selection" style="left: 35%; width: 30%;"></div>
  <div class="slider-handle round" style="left: 35%;"></div>
  <div class="slider-handle round" style="left: 65%;"></div>
</div>


#slider12a .slider-track-high, #slider12c .slider-track-high {
  background: green;
}

#slider12b .slider-track-low, #slider12c .slider-track-low {
   background: red;
}

#slider12c .slider-selection {
   background: yellow;
}

Can't set initial value

Angular binding via ng-model only works one way. If I move the slider, my scope variable is changed accordingly. The binding from the UI to the script works. However, if I change the value of the scope variable, the slider does not change.

In fact, I am unable to set an initial value per the doc in the "slider" directive. e.g. value="7". I did find that if data-slider-value="7" does work to set the initial value. It does not, however, make the Angular binding work.

Formatter renders the function itself

If you have a formatter on one slider, it does not get rendered anymore, but instead you see the function contents!
Regression identified, I create a fix that I tested on my side...

Range not working on version 0.1.17?

Hi.

Just updated to version 0.1.17, and even though setting my slider value as an array:

<slider ng-model="range" step="1" min="1" max="10" value="[1, 10]"></slider>

...I don't get a range slider.

Is it me or the update?

Formatter with HTML code and/or Bind

Hi all,
one of my need with Angular Bootstrap Slider is have a custom Tooltip.
Formatter works fine but it take only text plain, i'm not able to use an HTML tag or insert a bind of a value in $scope {{}}.
It is possible render HTML code inside Tooltip via formatter attribute?

Labels doesn't render right at start

The page that contain the slider doesn't render right the labels, as in the attached picture.
But when i select another value on the slider the labels was rendered right.
How could i fix this behaviour?
Could I refresh the slider by my controller?

schermata 2015-11-10 alle 17 54 41

Exception with the latest version

Hi,

I updated for the last version to have the correction of the 2 way data binding, but i got an exception:


RangeError: toFixed() digits argument must be between 0 and 20
    at Number.toFixed (native)
    at Slider._applyToFixedAndParseFloat (http://localhost:3000/bower_components/seiyria-bootstrap-slider/js/bootstrap-slider.js:1305:28)
    at Slider._applyPrecision (http://localhost:3000/bower_components/seiyria-bootstrap-slider/js/bootstrap-slider.js:1297:17)
    at Slider.setValue (http://localhost:3000/bower_components/seiyria-bootstrap-slider/js/bootstrap-slider.js:732:30)
    at createNewSlider (http://localhost:3000/bower_components/seiyria-bootstrap-slider/js/bootstrap-slider.js:614:9)
    at new Slider (http://localhost:3000/bower_components/seiyria-bootstrap-slider/js/bootstrap-slider.js:301:20)
    at HTMLInputElement.<anonymous> (http://localhost:3000/bower_components/seiyria-bootstrap-slider/js/bootstrap-slider.js:152:25)
    at http://localhost:3000/bower_components/jquery/dist/jquery.js:144:20
    at Function.jQuery.extend.map (http://localhost:3000/bower_components/jquery/dist/jquery.js:467:13)
    at jQuery.fn.jQuery.map (http://localhost:3000/bower_components/jquery/dist/jquery.js:143:33)

Here is the markup:

 <slider ng-model="range.value" range="true" step="range.step" min="range.min" max="range.max" tooltip_split="true"></slider>

And here is the controller:

 $scope.range = {
        min: 10000,
        max: 1000000,
        step: 10000,
        value: []
      };
      $scope.delayedMin = parseInt($scope.allFilters.priceMin, 10);
      $scope.delayedMax = parseInt($scope.allFilters.priceMax, 10);
      $scope.range.value = [$scope.delayedMin,$scope.delayedMax] ;

Incoming Attribute Issues

The attributes with camel case (i.e. attrs.tooltipSeparator, attrs.tooltipSplit, etc) need to be all lowercase, as they're not currently matching and setting the options correctly. Also "attrs.formater" is spelled incorrectly/inconsistently from the bootstrap-slider API.

Submitted pull request for you to merge if accepted...

Slider not updating when slider value change

Hi,

I'm trying to implement a autoplay function and trying to change the slider when "slider value" changes.

$scope.test = function () {
            setInterval(function () {
                $scope.slider.value += 1;
                console.log('Count : ' + $scope.slider.value);
            }, 1000);
        };

when i try this, it's not moving my slider according to the slider value.

Coudn't catch any event on v1.3.0

I use v.1.1.1, and have such construction:

<div slider ng-model="calcData.periodMonth" min="periodMonth.min" max="periodMonth.max" on-stop-slide="updateProducts()"></div>

But now it seems broken.
How could I fix this?

Even events example from test.html is not working now.

no such method 'setValue' for slider widget instance

Hi,

I'm trying to use this durective in my application, but no way.
I always have an "no such method 'setValue' for slider widget instance" Error, and my DOM is not like the one in your test page :

<div slider-id="mySlider" ng-model="slider.sliderValue" value="10" min="5" max="100" step="5" range="false" precision="2" reversed="false" orientation="horizontal" handle="round" enabled="true" ng-disabled="false" naturalarrowkeys="false" class="ng-isolate-scope ng-valid">
  <input class="slider-input ui-slider ui-slider-horizontal ui-widget ui-widget-content ui-corner-all" type="text" aria-disabled="false"></input>
</div>

Has someone an idea on my trouble ?

Clicking on the slider line (VS dragging handles) doesn't invoke change of UI using change event

UI and model are out of sync using the change event, because change event is not invoked on the UI, only the model is adapted.
I can see the reason why this is done, because following the bootstrap slider documentation and implementing 'change/onchange' event handler, it generates a warning.

I have resolved this locally by renaming the change event handler onchangeslide.

Now when you click on the slider line (VS dragging the slider handles), which is a common thing to do for a user, both the model and view are updated, as expected.

I will make a pull request for this, also i will change the readme to accommodate the event handlers, if you don't mind?

Which notation of event handlers is preferred? on 'onslide' or 'on-slide' ?

Update bower.json

Hello,

bower.json has version 0.0.6 but version 0.1.1 is out.

Can you update it please? thanks!

Tick Labels does not render

Tried to use this slider on Angular as you sugges on this page:

<slider ng-model="sliders.sliderValue" min="testOptions.min" step="testOptions.step" max="testOptions.max" value="testOptions.value"></slider>

But, mine differ a little bit, I need to have labels so, using options from Bootstrap Slider, like this: data-slider-ticks-labels="['$0', '$100', '$200', '$300', '$400']", but this does not work properly...

In my case I have tried:

<slider ng-model="stuff" ng-click="doSomething('value')" min="0" step="0.5" max="5" slider-ticks-labels="['0', '0.5', '1.0', '1.5', '2.0', '2.5', '3.0', '3.5', '4.0', '4.5', '5.0']"></slider>

<slider ng-model="stuff" ng-click="doSomething('value')" min="0" step="0.5" max="5" ticks-labels="['0', '0.5', '1.0', '1.5', '2.0', '2.5', '3.0', '3.5', '4.0', '4.5', '5.0']"></slider>

None of the above works, and the slider stays like this:
image

scale option is taking length of the array instead of value in the array

As I give scale values in array, it takes the array length for positioning, and array values as label. It may be an issue or enhancement, we need to give value and custom label in the array as an object, and we may use that value for positioning the label

Ex:- SCALE - [{val:5, label:"low"}, {val:10, label:"medium"}, {val:15, label:"high"}]

TypeError: Cannot read property 'prototype' of undefined

Bootstrap slider events are called twice

I tried listening to 'slideStop' event and it was called twice because of this:

$.fn.slider.Constructor.prototype.enable = function () {
    if (this.touchCapable) {
        // Touch: Bind touch events:
        this.picker.on({
            touchstart: $.proxy(this.mousedown, this)
        });
    } else {
        this.picker.on({
            mousedown: $.proxy(this.mousedown, this)
        });
    }
}

On bootstrap slider 3.0 this is already handled.

Attribute tooltip in conflict

I would like to hide tooltips on my slider.

So, I use the "tooltip" option that I set to "hide".

The result is, cause of an other angular directive for my tooltips, that I've got a global "hide" tooltip on my slider.

2015-05-17 23_23_23-demo - opera

Nice isn't it ;-)

What about that ?

I can see one easy solution :

  • have an alias to the "tooltip" attribute, like "slider-tooltip" (easy, I can make a PR)

What do you think about it ?

Doesn't work with v4.8.1

What version of bootstrap-slider does this correlate to.

It seems like this is completely broken with the new version v4.8.1.

Firstly I get an error on line 101 saying that constrructor doesnt exist. I can fix that by making it lowercase constructor.

Then I get an issue with _applyToFixedAndParseFloat in bootstrap-slider, I think because I am using it as a range and sometimes the num getting passed in is an array from the looks of it. so toFixed doesn't exist as a function.

Can you recommend a version of bootstrap slider that this will work with or help me with what needs changing (even if its vague)?

Cheers

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.