Put label inside slider
Is it possible to configure Labels to show inside slider ?
Currently no. But I would accept a pull request that supports that functionality On Sun, Jul 31, 2016 at 9:37 PM HUY NGUYEN [email protected] wrote:
Is it possible to configure Labels to show inside slider ?
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/tannerlinsley/nz-toggle/issues/34, or mute the thread https://github.com/notifications/unsubscribe-auth/AFUmCcfwnnZ19fj70jOo0AQX36aRIKw-ks5qbWnjgaJpZM4JZN4e .
I wanted to show the values of the toggle (in my case on / off) so in the directive template I changed:
<div class="nz-toggle-handle"></div>
to
<div class="nz-toggle-handle"><label ng-show="showLabels">{{ngModel}}</label></div>
then in function parseOptions() I added 'showLabels' to the attribute overrides.
and then I added
.nz-toggle-handle { text-align: center; }
.nz-toggle-handle label { cursor: pointer; }
to my CSS.
You can now use it like this:
<nz-toggle ng-model="myModel" show-labels="true" val-true="'ON'" val-false="'OFF'"></nz-toggle>
HTH