6

am looking to customize the ion-toggle, to show custom text. I need it to say Yes/No. Tried looking for solutions and found that we can use ion-toggle-text. But that solution does not seem to work in ionic2. Below is the code snippet am using. Tried to use ng-true-value but did not work either.

<ion-toggle ion-toggle-text="Yes;No" ng-true-value="Yes" ng-false-value="No">
</ion-toggle>

I could not find anything related to this in ionic documentation for ion-toggle. Can you pls let me know how do I achieve this functionality?

csharpnewbie
  • 789
  • 2
  • 12
  • 33

1 Answers1

0

ion-toggle-text paramter was only available in ionic 1 . For ionic 2 and later, you cannot place text on toggle. If you want to make a custom button, the best way to make your own toggle button on a pattern described here : https://www.w3schools.com/howto/howto_css_switch.asp and then add text within it.

arkoak
  • 2,437
  • 21
  • 35