I have an rzslider that is set to default values.
HTML:
<div id="slider">
<rzslider class="with-legend"
rz-slider-model="slider.value"
rz-slider-options="slider.options">
</rzslider>
</div>
Javascript:
$scope.slider = {
this.value = 0;
this.options = {
floor: 0,
ceil: 0
}
Inside a Watch Expression, there is code that updates the slider's options:
$scope.$watch('foo', function () {
$scope.slider.value = 0;
$scope.slider.options.floor = 0;
$scope.slider.options.ceil = foo.length;
}
After the code inside the watch expression is run, I expect the slider's ceiling option to change. However, even though the values of $scope.slider
have been updated correctly, the change does not appear on the slider itself.
I have tried to re-render the slider as documented on the AngularJS Slider Github page, but it doesn't fix the issue.
$scope.refreshSlider = function() {
$timeout(function() {
$scope.$broadcast('rzSliderForceRender')
})
}