Coding With Fun
Home Docker Django Node.js Articles Python pip guide FAQ Policy

How to set first ion-segment in ionic2?


Asked by Cynthia Morgan on Dec 05, 2021 FAQ



In ionic2 how to set the first ion-segment-button in ion-segment to be in active state? I have tried to do it with providing the active class to the ion-segment-button like : But this didn't worked. I want make the first ion-segment-button to be inactive state and corresponding, to be active state. How to do this?
Also,
We can access the Ionic Segment by using the standard <ion-segment> element. The following example provides a detailed explanation about how you can use segments with your Ionic application. This page is used to display the content for the user view. Here, we are going to use <ion-segment> inside of the <ion-content> element.
Keeping this in consideration, By using the <ion-segment> component, you can create the ionic segment button inside the ionic application. In the ionic segment <ion-segment> component is used inside the <ion-content> component. You can also use the Angular’s ngModel in the ionic segment. Segment buttons are a collection of related buttons within a segment.
Indeed,
We have an ionChange event on the ionic segment. This event is emitted when the value property of the segment has changed and any dragging pointer has been released from ion-segment.
Just so,
The ionic segments component displays a group of related buttons, sometimes known as segmented controls, in a horizontal row. They can be displayed inside of a toolbar or the main content. The functionality of the Ionic segment is the same as Ionic tabs, where you select the one tab that will deselect all other tabs.