JulioWar / jw-bootstrap-switch-ng2

Bootstrap Switch for Angular 2+
https://juliowar.github.io/jw-bootstrap-switch-ng2/
MIT License
43 stars 14 forks source link

Make OFF label text visible, when the value is true and the switch is ON #8

Closed jainanuj0812 closed 7 years ago

jainanuj0812 commented 7 years ago

While using this plugin, one limitation that I faced is that the label for the off option is not visible. Can we have a option to make the label for both the option visible all the time

JulioWar commented 7 years ago

I don't understand what are you trying to do but if you want to show the value of the off option you can change the label text when the value has change.

<bSwitch
          [switch-label-text]="(state) ?  'OFF' :  'ON' "
          switch-off-text="ON"
          switch-on-text="OFF"
          [(ngModel)]="state">
  </bSwitch>
jainanuj0812 commented 7 years ago

@JulioWar, Thanks man! ya that's what I want.