tb / ng2-nouislider

Angular2 noUiSlider directive
http://tb.github.io/ng2-nouislider/
MIT License
184 stars 114 forks source link

Slider Update on Click event #146

Closed shankmr closed 6 years ago

shankmr commented 6 years ago

How can I update slider value when someone clicks anywhere on the slider? It is working in the demo but how can I use it in my angular2/4 app?

kiqq commented 6 years ago

This is slider's default behaviour, so you should in slider config:

shankmr commented 6 years ago

I tried with setting behavior but it's not working. here is my HTML element <nouislider #slider [(ngModel)]="zoom" [min]="zoomMin" [max]="zoomMax" [step]="0.1" [behaviour]="tap" (ngModelChange)="updateSlideValue()">

kiqq commented 6 years ago

It looks fine. Any errors in console?

shankmr commented 6 years ago

No error. It just doesn't update slider. Is there anything I can do to read click area value?

kiqq commented 6 years ago

https://stackblitz.com/edit/angular-cyto93 This is project with your code. How does it work in your environment?

shankmr commented 6 years ago

I got the issue. I have to override CSS and in order to achieve that I reduced the height to 2px and that's why it is not working. I changed the height and got it working. Thanks

kiqq commented 6 years ago

Ok no problem. Please close issue