Skip to content

Commit 881c321

Browse files
committed
Update ReadMe
1 parent 75ce131 commit 881c321

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

README.md

+14-1
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,7 @@ The default options are:
187187
minRange: 0,
188188
id: null,
189189
translate: null,
190+
getLegend: null,
190191
stepsArray: null,
191192
draggableRange: false,
192193
draggableRangeOnly: false,
@@ -257,9 +258,21 @@ $scope.slider = {
257258
};
258259
```
259260

261+
**getLegend** - _Function(value, sliderId)_: Use to display legend under ticks. The function will be called with each tick value and returned content will be displayed under the tick as a legend. If the returned value is null, then no legend is displayed under the corresponding tick.
262+
260263
**id** - _Any (defaults to null)_: If you want to use the same `translate` function for several sliders, just set the `id` to anything you want, and it will be passed to the `translate(value, sliderId)` function as a second argument.
261264

262-
**stepsArray** - _Array_: If you want to display a slider with non linear/number steps. Just pass an array with each slider value and that's it; the floor, ceil and step settings of the slider will be computed automatically. The `rz-slider-model` value will be the index of the selected item in the stepsArray.
265+
**stepsArray** - _Array_: If you want to display a slider with non linear/number steps.
266+
Just pass an array with each slider value and that's it; the floor, ceil and step settings of the slider will be computed automatically. The `rz-slider-model` value will be the index of the selected item in the stepsArray.
267+
268+
`stepsArray` can also be an array of objects like:
269+
270+
```js
271+
[
272+
{value: 'A'}, // the display value will be *A*
273+
{value: 10, legend: 'Legend for 10'} // the display value will be 10 and a legend will be displayed under the corresponding tick.
274+
]
275+
```
263276

264277
**draggableRange** - _Boolean (defaults to false)_: When set to true and using a range slider, the range can be dragged by the selection bar. *Applies to range slider only.*
265278

0 commit comments

Comments
 (0)