Reputation: 165
Here i want to get the sliderValue in onchange event of javascript function. Currently I am using document.queryselector instead of i want to set it in scope of sliderValue.
Code:
<input id="slider" type ="range" min="{{sliderMin}}" onchange="updateSlider()" max="{{sliderMax}}" step="{{sliderStep}}" value="{{sliderValue}}" />
Upvotes: 0
Views: 65
Reputation: 1270
I can't agree with Sid response. Angular best practice is to use ngchange:
<input id="slider" type ="range" min="{{sliderMin}}" ng-change="updateSlider(sliderValue)"
max="{{sliderMax}}" step="{{sliderStep}}" value="{{sliderValue}}" />
Upvotes: 0
Reputation: 7166
Try this:
onchange="angular.element(this).scope().updateSlider(this)"
Upvotes: 2