tb / ng2-nouislider

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

not updating model #128

Open piskula opened 6 years ago

piskula commented 6 years ago

Hi,

I have use-case: when range is changed, also change ngModel to [min,max]. But I always have to click twice, first time range is updated and then ngModel. This is how I use it:

<div class="format-slider">
  <nouislider [config]="upperConfig"
              [step]="step"
              [min]="mRangeChosen[0]"
              [max]="mRangeChosen[1]"
              (change)="onChange($event)"
              [ngModel]="mRangeChosen" ></nouislider>
  <app-timeline-scale [min]="mRangeChosen[0]" [max]="mRangeChosen[1]"></app-timeline-scale>
</div>

Here is live demo and Here is source. Problem is when you enlarge chosen range in upper-slider. This method in your code is called twice, but in wrong order and I don't know how to force timeline to put handle to right position, because in model the value is correct but handle is rendered on bad position.

Looking forward to your reply, thank you

piskula commented 6 years ago

timeline-slider This is how I partially solved it.

dineshnagarit commented 6 years ago

I have the same scenario, @piskula were you able to find the solution?