0

I am working on a project that aims to display literacy rates around the world for particular years. Currently, we have data ranging from 1475 to 2015. However, not every single year holds data. Only 10-12 years actually hold some data. As a result, I don't want the user to have to drag and search between every single year for one that holds data.

I am not sure how to make the mat-slider only pick certain years. Here is the code I currently have for the mat-slider:

<div id = "sliderBox">
    <mat-slider [(ngModel)] = "currentYear" min="1475" max = "2015"  (slideend)="onSlide()" (pointerup)="onSlide()"></mat-slider>
</div>

So basically I want currentYear to only ever be certain values e.g. 1475, 1677, 1948 etc...

Thanks in advance!

  • you say 10-12 only hold data. Is it possibile that the number of years holding data is increasing? – officialMKL May 03 '21 at 15:41
  • Right now every single year between 1475 and 2015 holds a value. I would like to limit it to certain values instead. The number of years holding the data won't increase. – Hamza Qureshi May 03 '21 at 16:38

0 Answers0