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">
4

1 Answer 1

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;
  }
1
  • 1
    function call did not get triggered this way in angular 6 at least on my end Commented Mar 19, 2020 at 15:07

Not the answer you're looking for? Browse other questions tagged or ask your own question.