ngx-slider
ngx-slider copied to clipboard
Don't translate labels when combined.
Is there a way to not translate the labels when they are combined?
For example, I want the slider to have a % sign after the min and max values but when they are combined I only want a % sign after the max value.
@tstephansen You can provide an option: https://github.com/angular-slider/ngx-slider/blob/master/src/ngx-slider/lib/options.ts#L90
/** Custom function for combining overlapping labels in range slider.
It takes the min and max values (already translated with translate fuction)
and should return how these two values should be combined.
If not provided, the default function will join the two values with
' - ' as separator. */
combineLabels?: CombineLabelsFunction = null;
In your case, something like (untested)
sliderOptions: Options = {
floor: floor,
ceil: ceil,
combineLabels = (min, max) => { return minValue.replace("%", "") + " - " + maxValue }
};