Alex Wohlbruck
Alex Wohlbruck

Reputation: 1436

Angular Material - Customize md-slider draghead text

I have a slider in my Angular Material app, which has values that range from 0.0 to 1.0, with increments of 0.1. These are the values that I need in my model, but from the UI, I want the slider to display range 0 to 10 with increments of 1, or maybe a percentage value if that's possible. Is there any way to do this?

enter image description here

Upvotes: 1

Views: 1396

Answers (2)

Daniel
Daniel

Reputation: 3514

Custom display texts are not yet natively supported by Angular Material Design. Such a feature was proposed back in 2014, but unfortunately no one implemented it and the proposal was finally closed in April this year.

As any further feature development efforts are moved towards material 2, I currently see no chances for such a feature to be implemented.

Upvotes: 1

Ramin Esfahani
Ramin Esfahani

Reputation: 220

Based on this documentation, At first you need to set md-discrete directive of md-slider tag to true to make the slider steps discrete, then set the step directive to value that you want to increment each step. Regards

Upvotes: 0

Related Questions