1

I have created a slider but i want values in the different range. This is how the slider looks. But instead of 1-10 values, I want values to be 1 Lakh, 2 Lakhs, 3 Lakhs, 5 Lakhs, 10 Lakhs and more than 10 Lakhs. How do i set the value set which also prints the text. I have combined rg-slider with my code.

<rg-slider
    tracker-class="my-tracker rg-tracker-with-animation"
    navigator-class="my-navigator"
    bound-var="sliderValue"
    show-navigator="true"
    navigator-from="1"
    navigator-to="16">
</rg-slider>

1 Answer 1

4

It doesn't look like it was built into the rg-slider directive that you're using. Instead of complicating things, I would suggest that you use a more versatile one, like this:

http://angular-slider.github.io/angularjs-slider/index.html

Update:

Copy the following code into this jsfiddle and click run:

JS

var app = angular.module('rzSliderDemo', ['rzModule', 'ui.bootstrap']);

app.controller('MainCtrl', function ($scope, $rootScope, $timeout, $modal) {

   //Slider with ticks and values
    $scope.slider_ticks_values = {
        value: 0,
        options: {
            ceil: 5,
            floor: 0,
            showTicksValues: true,
            translate: function (value) {
                return value + ' Lakhs';
            }
        }
    };
});

HTML

<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.4.3/angular.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/angular-ui-bootstrap/0.14.3/ui-bootstrap-tpls.js"></script>
<script src="https://rawgit.com/rzajac/angularjs-slider/master/dist/rzslider.js"></script>
<div ng-app="rzSliderDemo">
    <div ng-controller="MainCtrl" class="wrapper">
        <header>
             <h1>AngularJS Touch Slider</h1>
        </header>
        <article>
             <h2>Slider with ticks and values</h2>

            <rzslider rz-slider-model="slider_ticks_values.value" rz-slider-options="slider_ticks_values.options"></rzslider>
        </article>
    </div>
</div>
Sign up to request clarification or add additional context in comments.

2 Comments

Thank you. but i want to print text along with my value. i am not getting how to do that

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.