Customized Values in AngularJS Slider

My slider currently has values ranging from 1 to 10, but I want to change them to 1 Lakh, 2 Lakhs, 3 Lakhs, 5 Lakhs, 10 Lakhs, and more than 10 Lakhs. How can I adjust the value set to display this text instead? I have incorporated rg-slider into my code. https://i.sstatic.net/WUf79.png

<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>

Answer №1

It appears that the rg-slider directive you are using does not have the functionality you are looking for. To simplify things, I recommend trying a more versatile slider such as this one:

Update:

To see the code in action, paste 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>

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Different tiers of log levels

I am trying to figure out how to log only "INFO" level messages to the console for users, and to a file store "DEBUG" level posts. Currently, I have come across a solution that involves using multiple "getLogger()" functions like so: log4js.getLogger(&ap ...

Determining the page's coordinates in ColdFusion

Whenever I use iframes or frames on older websites, I implement an additional security measure using a JavaScript function: <SCRIPT LANGUAGE="JavaScript1.1"> if (top == self) self.location.href = "../index.cfm"; </SCRIPT> I also include an ...

The Strophe.muc plugin and backbone improper binding of callbacks

Following the initial group message, I'm experiencing an issue with the strophe.muc plugin not responding to subsequent messages. Although I receive the first presence, message, and roster from the room, any additional messages and presence stanzas do ...

JavaScript is able to access the HTML content of the previously opened tab when saving the window

Seeking advice from the knowledgeable community at Stack Overflow! I have a project that I'm unsure how to start, and I could use some fresh ideas. My goal is to access the HTML source code of a previously opened tab or one that is still loading on m ...

Adjust the color of a contenteditable div once the value matches

I currently have a table with some contenteditable divs: <div contenteditable="true" class="change"> This particular JavaScript code is responsible for changing the color of these divs based on their content when the page loads. However, I am now ...

Error 404 in NodeJS: Page Not Found

I recently started working with NodeJS to develop an ecommerce application. I have a ready-made design and all the front-end components built using AngularJS code. Everything seems to work fine - when clicking on any menu, the page content changes along wi ...

Trouble with sending arguments to Express middleware

I'm currently working on developing a custom input validation middleware using Express. My aim is to create a middleware that takes 2 parameters in order to validate client input effectively. Despite referencing various sources, including the Express ...

Protractor Problem with Asynchronous Calls

New to Protractor, I started by using multiple 'its' in my code. However, I later consolidated everything into one 'it', resulting in the following structure: var UI = require('./../ui.js'); var co = require('co'); ...

"Implementing an Ajax request to loop through a JSON

I have received these results and now I want to display them in my view: val: {email: Array(1), first_name: Array(1)} email: Array(1) 0: "The email field is required." length: 1 __proto__: Array(0) first_name: Arra ...

Error: Unable to access the 'length' property of an undefined value | Solving the challenge of finding the shortest word within a string | Codewars Problem

I'm currently working on a function to find the shortest word in a given string of words. Issue: I encountered the error below TypeError: Cannot read property 'length' of undefined at findShort at Test.describe._ at /runner/fra ...

Incorporating a protected Grafana dashboard into a web application

I am looking to incorporate Grafana into my web application using AngularJS. The main objective is to allow users to access the Grafana UI by clicking on a button within my application. Setting up an apache reverse proxy for Grafana and ensuring proper COR ...

Is there a way to showcase an array parameter in a url's format?

Objective Currently, I am developing a project using NextJS 12 and I am facing an issue with passing an array as a parameter to the query. Desired Outcome The expected format for passing the array as a parameter should look like this: /path?address_id=1 ...

Fade-in animation of a clock on an SVG image

I am trying to achieve a unique fade-in effect for an SVG image in my HTML. The challenge is to make the fade-in start from the top of the image and progress in a circular motion until it completes a full circle. An example of the effect I am aiming for is ...

What methods are available to access a directive function within a controller function?

I am new to AngularJS and I am attempting to utilize the goToUserLocation() function from the userLocation directive within the getMyPosition() function in the MapController. The purpose behind this is that when a user clicks a button, I want to grab their ...

Res.redirect() showing unexpected behavior

In my current setup, I am utilizing a modified version of the vhost connect/express middleware. Within this middleware, there is a check for the presence of the www subdomain. If the subdomain is found, it should redirect to the host + path without the www ...

Ember JS: Master of Controlling

I am working with the following controllers: clusters_controller.js.coffee Portal.DashboardClustersController = Ember.ArrayController.extend dashboard_controller.js.coffee Portal.DashboardController = Ember.ArrayController.extend In my template, I am ...

Slider that allows range selection after midday

Currently facing a dilemma using the noUiSlider plugin. I have set up a time range picker starting from 6 am to 6 am the following day. Everything works smoothly until it reaches 23:59, but I need it to display 1:00, 2:00 instead of 25:00, 26:00 for the ...

Creating a Pop-Up on Website Load with HTML, CSS, and Jquery

<script> // utilizing only jquery $(document).ready(function(){ $('#overlay-back').fadeIn(500,function(){ $('#popup').show(); }); $(".close-image").on('click', function() { $('#po ...

Sending data from a JSP page to a JavaScript function

I am working on a script that dynamically adds text boxes based on a specific time interval. <script type="text/javascript> $(document).ready(function() { var data = $('#data').val(); var counter = 1; var d = new Date(); va ...

Invoking a class method through a dynamic function call with the use of setTimeout

In my JavaScript code, I have a structure similar to a class where I'm trying to call a function from the same level using a passed-in function name. Explaining this is a bit challenging, so let me illustrate with an example of what I'm aiming ...