Quantcast
Channel: Ionic Framework - Ionic Forum
Viewing all articles
Browse latest Browse all 49224

Hide and Show dynamically segments

$
0
0

@mburger81 wrote:

We have two or more segments and we would hide and show dynamically this segments depending on property, something like that

<ion-segment [(ngModel)]="connectionType" (ionChange)="segmentChanged($event)">
    <ion-segment-button value="local" *ngIf="showFirstSegment">
        First segment
    </ion-segment-button>
    <ion-segment-button value="local" *ngIf="showSecondSegment">
        Second segment
    </ion-segment-button>
    <ion-segment-button value="local" *ngIf="showThirdSegment">
        Third segment
    </ion-segment-button>
    <ion-segment-button value="local" *ngIf="showFourthSegment">
        Fourth segment
    </ion-segment-button>
</ion-segment>

The segment is not changing on changing properties showXXXXXSegment, only after click on some part of the segment the segment is re rendered with the right segments shown. I also tried to use hidden instead of ngIf

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 49224

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>