user7035864
user7035864

Reputation:

Angularjs-Slider onchange event not firing up doesn't work

how to handle change event on angularjs rzslider:

<rzslider  rz-slider-model="range_slider_ticks_values.minValue" rz-slider-high="range_slider_ticks_values.maxValue" rz-slider-options="range_slider_ticks_values.options"></rzslider>

Upvotes: 2

Views: 1314

Answers (2)

fatCop
fatCop

Reputation: 2576

$scope.onSelectorSliderChange = function () {
  console.log($scope.range_slider_ticks_values.value);
};

$scope.range_slider_ticks_values = {
    value: 'DAY',
    options: {
        showTicksValues: true,
        stepsArray: [
            {value: 'Day'},
            {value: 'Week'},
            {value: 'Month'}
        ],
        onEnd: $scope.onSelectorSliderChange
    }
};

Put the function you want to trigger on change to options onEnd. Hope it helps.

Upvotes: 0

Sagar Mahajan
Sagar Mahajan

Reputation: 112

In the default options of rzSlider you can define function for onChange with below params

onChange - Function(sliderId, modelValue, highValue, pointerType): Function to be called when rz-slider-model or rz-slider-high change. If an id was set in the options, then it's passed to this callback. pointerType is either 'min' or 'max' depending on which handle is used.

Refer: https://github.com/angular-slider/angularjs-slider

Upvotes: 1

Related Questions