Angular material slider change event not working

I use angular2 md-sliderin the component, and I have a problem with the change event:

  • first I change the value with a slider, for example, to 20.
  • next I change the value to 19 using the button and function in the controller
  • and again change the value to 20 using the slider. But it does not fire a change event.
+4
source share
1 answer

You can correct the value yourself.

When you change the slider using the method, also emit the change:

this.slider.value = 10;
this.slider.change.emit({ source: this.slider, value: this.slider.value });

I believe they fixed it, but it helps if you want the event to be emitted when the value was also changed using the method.

0
source

Source: https://habr.com/ru/post/1682755/


All Articles