tb / ng2-nouislider

Angular2 noUiSlider directive
http://tb.github.io/ng2-nouislider/
MIT License
184 stars 114 forks source link

To Get Min And Max updated Range Value in the tooltip #158

Closed DonaldsMC closed 6 years ago

DonaldsMC commented 6 years ago

Hi All,

i am trying to change the tooltip label using tooltip property in the ng2-nouislider.

when both min handle and max handle range are collide(are in the same range). then i need to show the tooltip in the form of YYYY-YYYY. please refer below image for the reference.

labelformat

So in tooltip in config, i am calling MyFormatter class as below

tooltips: [new MyFormatter(this._dataService), new MyFormatter(this._dataService), new MyFormatter(this._dataService)]

And in the MyFormatter class using "to" and "from" methods of NouiFormatter

export class MyFormatter implements NouiFormatter { to(value: number): string { let output = value + " Day"; let playerObj = this._dataService.getPlayerObject(); if (value != 1) { output += "s";} return output; }

from(value: string): number { return Number(value.split(" ")[0]); } }

Here i need to get min and max range value so that i can check the condition and format the label. So could you please any one suggest how to get dragged(updated) min and max value here.

Thanks in advance.