1

I can able to get the expected result in Chrome and Firefox but not in IE 11. Even ngModel is also not updating when I change the range.

With the below code I can able to get the alert in the IE but the method assigned to (change) is not working.

Any suggestions please!

<input type="range" 
       min = "{{_minimumRangeOfSlider}}" 
       max="{{_maximumRangeOfSlider}}" 
       value="{{_currentRange}}"
       (change) = "plainValueChanged($event)"
       onchange="alert()"
       [(ngModel)] = "_currentRange"
       class="reports-range-slider">
Devx
  • 41
  • 1
  • 3

1 Answers1

3

I got this solved by adding a change event to the range input like so:

<input type="range" [(ngModel)]="_currentRange" (change)="onChange($event.target.value)">

You have to make a onChange function in your component to assign what is passed to your value variable.

onChange(value:number):void {
    this._currentRange = value;
  }
Marin Petkov
  • 2,128
  • 4
  • 17
  • 23