angular-slider/angularjs-slider

rzSlider onEnd event is called everytime when there is a user action in UI.

akgee10 opened this issue · 2 comments

I am using a rzSlider which is inside a ng-repeat block. I need to call a specific function when the slider is moved so I have used onEnd function as below to call that function and it is working properly.

But the issue here is below html has ng-click="sort()", when this function is called then onEnd:triggerFilter() function is also hitting unnecessarily.

Slider
Sort

Here is my slider options looks like

$scope.filters=[
{
name:"first",
min:0,
max:5,
options:
{
floor:1,
ceil:2
},
},
{
name:"second",
min:0,
max:5,
options:
{
floor:1,
ceil:2
},
},];

$scope.triggerFilter = function(type,filter){
// All slider code logic resides here.
};

$scope.refreshSlider = function() {
$timeout(function() {
$scope.$broadcast('rzSliderForceRender')
})
}

I suspects this is happening because of refreshSlider function, so I removed this function but it doesn't worked out. Anyone please help me on this issue.

Closing this for cleanup. If you are still facing the issue, please comment to reopen and provide a demo.