I am using Angular Material v2 md-sliderin component
@Component({
selector: 'ha-light',
template: '<md-slider min="0" max="1000" step="1"
[(ngModel)]="myValue" (change)="onChange()"></md-slider>
{{myValue}}',
styleUrls: ['./light.component.css']
})
export class LightComponent implements OnInit {
myValue = 500;
constructor() { }
ngOnInit() { }
onChange(){
console.log(this.myValue);
}
}
and it myValueupdates just fine, and the method onChangeis called, but only when I stop sliding and release the mouse button.
Is there a way to update myValueand also call a function when I have a myValueslider?
I noticed an attribute aria-valuenowthat changes when I'm gliding, but I'm not quite sure how to use it for what I need (if it can be used at all).
Marek source
share