Actually I have one toggle button component and I used the ::before pseudo class to insert text into it. Now when I'm clicking on toggle's button text , toggle button state changes. how to avoid this?
Ionic 2 code:
<ion-item>
<ion-label>some content</ion-label>
<ion-toggle (ionChange)="someMethod($event)"></ion-toggle>
</ion-item>
classes :
.toggle-icon {
display: inline-block !important;
}
.item-inner {
display: block;
}
ion-toggle::before {
content: "Set as Default";
padding-left: 11%;
}
Requirement: I can only create my required view by using above scheme.
Expected: I want someMethod() to be called when toggle button is clicked, not pseudo text.
Thanks for any help!!